December 27, 2007 1

How to remove all special characters from a string

By J in Tags: ,

protected string StripSpecChars(string txtIn)
{
    string txtOut = Regex.Replace(txtIn, @"[^\w\.@-]", "").Trim();
    return txtOut;
}

Tags: ,

One Response to “How to remove all special characters from a string”

  1. lsi says:

    is it availible in German?

Leave a Reply