trim(str) {
return str.replace(/(^\s*)|(\s*$)/g, "");
}
limitConst(str) {
return str.replace(/[^\-?\d.]/g, "");
}
removeCinString(str) {
let reg = /[^a-zA-Z]/g;
return this.removeEinString(str.replace(reg, ""));
}
removeEinString(str) {
let reg = /[u4E00-u9FA5]/g;
return str.replace(reg, "");
}
verifyCe(str) {
let reg = /[^[\u4e00-\u9fa5_a-zA-Z]+$]/g;
return reg.test(str);
}
limitSign(str) {
let arr = str.split("");
let newIndex, newStr;
arr.forEach((text, index) => {
if (this._singString.indexOf(text) != -1) newIndex = index;
});
if (arr[newIndex]) {
newStr = arr[newIndex];
} else {
newStr = "";
}
return newStr;
}