UNPKG

npmchenwei111

Version:

test1111

15 lines (14 loc) 388 B
/** * Created by chenwei on 2017/7/26. */ export function rebuildString () { String.prototype.startsWith = function (prefix) { return new RegExp('^' + prefix).test(this) } String.prototype.endsWith = function (suffix) { return new RegExp(suffix + '$').test(this) } String.prototype.contains = function (suffix) { return suffix && this.indexOf(suffix) !== -1 } }