yao-stringutils
Version:
字符串处理工具集,诸如'contains', 'toLength', 'getLeft', 'getLeftOuter', 'getRight', 'getRightOuter', 'getSection', 'getSectionOuter'……函数
13 lines • 425 B
JavaScript
const StringUtils = require('./src/StringUtils')
module.exports = {
StringUtils,
bindStringPrototype() {
let ms = ['contains', 'toLength', 'getLeft', 'getLeftOuter', 'getRight', 'getRightOuter', 'getSection', 'getSectionOuter'];
for (let m of ms) {
String.prototype[m] = function (...p) {
return StringUtils[m](this, ...p)
}
}
return ms;
}
}