Home | Articles|Namespace|Interview Questions|Tools|Jobs|Projects|Community
Asp.net Tutorials

»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books

»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects

»Competition
Community
Winners
Prizes
Write For Us
Members

»Other Resources
Links
Dotnet Resources

Function to strip email from text

Hi here is a function i created to strip email from a text. you can use it for a variety of purposes


using System.Text;
using System.Text.RegularExpressions;

private string stripEmails(string str)
{
MatchCollection Match;
int i;
string str1 = "";
Match = Regex.Matches(str, @"([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})");
string[] strTemp = new string[Match.Count];
for(i=0;i<=strTemp.Length-1;i++)
{
strTemp[i] = Match[i].Value;
str1 += str.Replace(strTemp[i],".");
}
return str1;
}

Have a Question and dont know the answer post it below and get answers in minutes

Due to spam this feature is disabled
To get answers fast , make sure you enter a detailed subject for example: "DataGrid issues need answer" not "DataGrid"

Subject:

Catjegory Name:

Message:



© 2008 dotnetwatch.com -- Privacy policy