How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right

You can use logic:

output = System.Text.RegularExpressions.Regex.Replace(your_String, "[^\w\.@-]","")

or

output = System.Text.RegularExpressions.Regex.Replace(yourString, "[^\w\.@-]"," ")

regex

Or read this post:
Replace (regex) problems

9 Likes