i defined ToHtml() extension for string class and convert break to <br/>.
how can detect hyper link and convert to <a> element?
public static class StringExtension
{
public static string ToHtml(this string item)
{
//\r\n windows
//\n unix
//\r mac os
return item.Replace("\r\n", "<br/>").Replace("\n", "<br/>").Replace("\r", "<br/>");
}
}
c#, asp.net
see this one, uses regex