hi there
how to trim the word using the javascript.
i mean
x=" Content"
resuld has to x="Content"
how to do this using javascript
my code is var s=new String(x);
m=s.trim();
I got the Error: Object not found;
please help me
buddu
Printable View
hi there
how to trim the word using the javascript.
i mean
x=" Content"
resuld has to x="Content"
how to do this using javascript
my code is var s=new String(x);
m=s.trim();
I got the Error: Object not found;
please help me
buddu
Use trim in a VBScript function.
I wrote this a little while back:
Try it out and let me know if it works for you...Code:function Trim(strString){
//Trim() function removes spaces at either end
//of the string and removes all extra spaces
var strSplit; //Array of arg string split on spaces
var strReturnString; //String to return
// Split the string on all spaces.
//All spaces are discarded and only
//the characters remain.
// /\s+/ is a Regular Expression that
//represents a space character
strSplit = strString.split(/\s+/);
//Rejoin the string using a space.
strReturnString = strSplit.join(" ");
return strReturnString;
}//end function