How to remove all special characters from a string

protected string StripSpecChars(string txtIn)
{
    string txtOut = Regex.Replace(txtIn, @"[^\w\.@-]", "").Trim();
    return txtOut;        
}
If you liked this post, 🗞 subscribe to my newsletter and follow me on 𝕏!