Monday, 11 March 2013

Regular Expression to remove non-printable character

Following simple regular expression can be used to reomve non-printable charcter from your string or data.

Code Sample :

string str = "342343\r\n24232234234234234";
 

Regex digitsOnly = new Regex(@"[\x00-\x1F]");str= digitsOnly.Replace(str,
"");

ASCII code table

No comments:

Post a Comment