name = ' Linux ';
function trim(str) {
return str.replace(/(^\s*)|\s*$/g,'');
}
alert(name.length);
alert(trim(name).length);
JS-去除左右空格
猜你喜欢
转载自blog.csdn.net/weixin_41998682/article/details/91820359
今日推荐
周排行