如何去掉str中兩側的數字?
正則方式:
var a = ",1,2,3,4,5,6,7,8,9,10,11,12,13";
var r = /,1(?=,)|,1$/g; //替換其他數字需要把兩個數字都改,如 var r = /,3(?=,)|,3$/g;
var b = a.replace(r,"");
split方式:
var a = ",1,2,3,4,5,6,7,8,9,10,11,12,13";
var r = a.split(",");
var b="";
for(var i=0;i
上一篇下劃線怎么去除
下一篇wps怎么另存為樣式集