KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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). "Hello there(hello#)".Replace(regex-i-want, ""); should give "Hellotherehello" I have tried "Hello there(hello#)".Replace(@"[^A-Za-z0-9 ]", ""); but the spaces remain.
Tags (comma-separated)
Save Edits
Cancel