»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 textHi 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;
} |
|