eladr
asked on
trim in javascript
how can i do that?
i need just like in VB : trim(str)
e.
i need just like in VB : trim(str)
e.
var str = " this is a test ";
str = trim(str);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
KnightEknight
good work.
good work.
var str = " this is a test ";
str = Trim(str);
str = Trim(str);
the function is case sensitive
str = trim(str);
:)
str = trim(str);
:)
This post compares a variety of ways to <a href="http://blog.stevenlevithan.com/archives/faster-trim-javascript">trim in JavaScript</a>.
{
return str.replace(/^\s*|\s*$/g,"
}