If you recognize this, yes it originally came from 4guysfromrolla.com.
function Trim(str)
{
return RTrim(LTrim(str));
}
** This function requires the JavaScript functions for LTrim() and RTrim(). They can also be found by searching for "Trim".
Update, 3 Mar 2002: Desert Ghost from ASPMessageBoard.com suggested a better Trim() function for JavaScript.
function Trim(s)
{
return s.replace(/(^\s+)|(\s+$)/g, "")
}
|