var box = 'Mr.Lee is Lee L L sad L';
var boxarr=[];
var pos = box.indexOf('L');
while(pos>-1){
boxarr.push(pos);
pos= box.indexOf('L',pos+1);
}
alert(boxarr);
转载于:https://my.oschina.net/projerry/blog/479053
var box = 'Mr.Lee is Lee L L sad L';
var boxarr=[];
var pos = box.indexOf('L');
while(pos>-1){
boxarr.push(pos);
pos= box.indexOf('L',pos+1);
}
alert(boxarr);
转载于:https://my.oschina.net/projerry/blog/479053