C# – How to you strip non-ASCII characters from a string? (in C#)

asciic

How can you strip non-ASCII characters from a string? (in C#)

Best Answer

string s = "søme string";
s = Regex.Replace(s, @"[^\u0000-\u007F]+", string.Empty);