Created
November 11, 2013 18:21
-
-
Save csharpforevermore/7417789 to your computer and use it in GitHub Desktop.
Replace unprintable characters in a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string GetRidOfUnprintablesAndUnicode(string inpString) | |
{ | |
return inpString.Where(ch => ((int) (byte) ch) >= 32 & ((int) (byte) ch) <= 128).Aggregate(String.Empty, (current, ch) => current + ch); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment