no, trim doesnt exist but you can use this function to emulate it. Put it in the head of the document and call it like this...
Code:
newtxt = trim('fk dns fnds gkejgij');
... and spaces should be removed
Code:
function trim(txt){
var tmp = "";
var item_length = txt.length;
var item_length_minus_1 = txt.length - 1;
for (index = 0; index < item_length; index++){
if (txt.charAt(index) != ' '){
tmp += txt.charAt(index);
}else{
if (tmp.length > 0){
if (txt.charAt(index+1) != ' ' && index != item_length_minus_1){
tmp += txt.charAt(index);
}
}
}
}
return tmp;
}