Skip to content

Instantly share code, notes, and snippets.

@dstarh
Created April 9, 2013 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstarh/5342503 to your computer and use it in GitHub Desktop.
Save dstarh/5342503 to your computer and use it in GitHub Desktop.
string pattern = @"[^ -~]";
string input = THE XML STRING
string replacement = "";
Regex rgx = new Regex(pattern);
string result = rgx.Replace(input, replacement);
Console.WriteLine("Original String: '{0}'", input);
Console.WriteLine("Replacement String: '{0}'", result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment