给字符串对象添加宽字符截取方法
String.prototype.substr2=function(a,b){
var s = this.replace(/([^x00-xff])/g,"x00$1");
return(s.length<b)?this:s.substring(a,b).replace(/x00/g,');
}
DevOps
给字符串对象添加宽字符截取方法
String.prototype.substr2=function(a,b){
var s = this.replace(/([^x00-xff])/g,"x00$1");
return(s.length<b)?this:s.substring(a,b).replace(/x00/g,');
}