TEXT TO HTML REGEX METHOD



//TEXT TO HTML REGEX METHOD
public string TextToHtml(string inputtext )
{
inputtext = Regex.Replace(inputtext, "<", "<") ;
inputtext = Regex.Replace(inputtext, ">", ">") ;
inputtext = Regex.Replace(inputtext, @"http://(.\S+)", "$1") ;
inputtext = Regex.Replace(inputtext, @"ftp://(.\S+)", "$1ftp://$1\">$1;") ;
inputtext = Regex.Replace(inputtext, @"news://(.\S+)", "$1;") ;
inputtext = Regex.Replace(inputtext, @"(\S+\@.*\..\S+)", "$1;") ;
inputtext = Regex.Replace(inputtext, "\n", "
") ;
inputtext = Regex.Replace(inputtext, @"\s\s", " ") ;
return inputtext ;
}