/**
 * 判断某个字符串是否包括查询得匹配字符串
 * @param {*} value 匹配字符串
 */
String.prototype.contains = function (value) {
  try {
    if (value.length == 0) {
      return true;
    }
    return this.indexOf(value) > -1;
  } catch (error) {
    console.error('字符串扩展方法错误', error)
  }
}
posted on 2020-11-09 13:49  code魔布  阅读(202)  评论(0)    收藏  举报