2013年11月3日星期日

js How to remove all spaces ah ? ? ?

js How to remove all spaces ah ? ? ?
------ Solution ---------------------------------------- ----

var str = "asdg asdgasa   sdgasetet ";
var st = str.replace(/(^/s*)|(/s*$)/g, "");
alert(st);

没有评论:

发表评论