Exercise I4 - remove unprintable characters from a string

Given an input string, remove all characters that are not printable.


Assuming ASCII - or something like ASCII - non-printing characters have ascii values of 31 or lower. You can match them with the following:


and then user Regex.Replace() to replace each of those characters with an empty string.