[JavaScript] JavaScript判断一个字符串是否包含指定的子字符串 →→→→→进入此内容的聊天室

来自 , 2019-02-10, 写在 JavaScript, 查看 188 次.
URL http://www.code666.cn/view/dc36f18a
  1. if (!Array.prototype.indexOf) {
  2.     Array.prototype.indexOf = function(obj, start) {
  3.          for (var i = (start || 0), j = this.length; i < j; i++) {
  4.              if (this[i] === obj) { return i; }
  5.          }
  6.          return -1;
  7.     }
  8. }
  9.  // http://www.sharejs.com
  10. if (!String.prototype.contains) {
  11.     String.prototype.contains = function (arg) {
  12.         return !!~this.indexOf(arg);
  13.     };
  14. }
  15.  
  16.  
  17. //javascript/8789

回复 "JavaScript判断一个字符串是否包含指定的子字符串"

这儿你可以回复上面这条便签

captcha