How to remove all special characters from a string
Thursday, December 27th, 2007
protected string StripSpecChars(string txtIn)
{
string txtOut = Regex.Replace(txtIn, @”[^\w\.@-]”, “”).Trim();
return txtOut;
}
protected string StripSpecChars(string txtIn)
{
string txtOut = Regex.Replace(txtIn, @”[^\w\.@-]”, “”).Trim();
return txtOut;
}
I’m using this function to filter common words out of a search query.
protected string removeCommonWords(string sourceStr)
{
string[] seperator = { ” “ };
string[] ignoreWords = { “a”, “all”, “am”, “an”, “and”, “any”, “are”, “as”,
“at”, “be”, “but”, “can”, “did”, “do”, “does”, […]
You are currently browsing the Calisto Mind weblog archives for December, 2007.