Here are some of the string functions I have written. They can be used either client-side or server-side, although smartRmHTML would need the server.HTMLEncode method removed if it were used client-side. Enjoy!
function autoHTML( strSrc,optAtt ) {
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// autoHTML function
// author: T. Kang
// contact: txkang@hotmail.com
// This function will make http,https,ftp,www and email strings clickable.
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
strSrc = strSrc.replace( /\s(https:\/\/|http:\/\/|ftp:\/\/|www.)([^\s]*)/gi,
' <a href=http://$2 ' + optAtt + '>$1$2</a>' );
strSrc = strSrc.replace( /\s([^\s]*@[^\s]*)/gi,' <a href=mailto:$1>$1</a>' );
return strSrc;
}