How do I strip non alphanumeric characters from a string and loose spaces in C# with Replace?
I want to keep a-z, A-Z, 0-9 and nothing more (not even \" \" spaces).<
var text = "Hello there(hello#)"; var rgx = new Regex("[^a-zA-Z0-9]"); text = rgx.Replace(text, string.Empty);