How to remove all special characters from a string

protected string StripSpecChars(string txtIn)
{
    string txtOut = Regex.Replace(txtIn, @"[^\w\[email protected]]", "").Trim();
    return txtOut;        
}
If you have any questions or comments, please post them below. If you liked this post, you can share it with your followers or follow me on Twitter!