var charPattern=/[^\u4E00-\u9FA5A-Za-z0-9]/;
function deleteAfterBefore(text){
var textCopy=text.slice();
var m=0;
while(charPattern.test(textCopy[m])){
text=textCopy.slice(m+1); //这是什么意思?
m++;
}
textCopy=text.slice(); //这又是啥意思?
var n=textCopy.length;
while(charPattern.test(textCopy[n-1])){ //这句?
text=textCopy.slice(0,n-1); //这句?
n--;
}
return text;
}
橋本奈奈未
相关分类