function String_rtrim()//returns string without right whitespace
{var xi = /\s*$/;var bx=this.replace(xi,""return bx}
String.prototype.rtrim=String_rtrim;String.prototype.chomp=String_rtrim;
function String_ltrim()//returns string without left whitespace
{var xi = /^\s*/;var bx=this.replace(xi,""return bx}
String.prototype.ltrim=String_ltrim;
function String_trim()//returns string without lead or trail spc
{var xi = this.rtrim();var bx=xi.ltrim();return bx}
String.prototype.trim=String_trim;
now just call somestring.trim() to return a string w/o leading or trailing space jared@aauser.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.