name = ' Linux ';
function trim(str) {
return str.replace(/(^\s*)|\s*$/g,'');
}
alert(name.length);
alert(trim(name).length);
name = ' Linux ';
function trim(str) {
return str.replace(/(^\s*)|\s*$/g,'');
}
alert(name.length);
alert(trim(name).length);