i used the bolow example.. none of it is worinking for trimming white spaces
- var a = String.trim(" Visit W3Schools ");
-
alert(a)
-
-
-
var sMyVar = new String (" testing trim ");
-
alert(sMyVar.trim());
-
-
-
var str = " blah blah ";
-
var trimmed = str.replace(/^\s+|\s+$/g, '') ;
-
alert(trimmed);
-
alert(trimmed.value.length);
-
q=str.trim();
-
alert(q);
-
alert("'" + str.trim() + "'");
all my need is to take off white spaces before and after a string but not inbetween a string.. ie.,
'' babe babe " should be ''babe babe"......
any help..
thanks in advance..
regards.
aswath.n.s
(knowledge is power)