common_util.js 422 B

123456789101112131415
  1. /**
  2. * Created by CSL on 2017-06-06.
  3. * public functions for web.
  4. */
  5. // 忽略大小写判断字符串是否和参数指定的字符串相同
  6. String.prototype.sameText = function (str) {
  7. return this.toLowerCase() == str.toLowerCase();
  8. };
  9. // 忽略大小写判断字符串是否有参数指定的子串
  10. String.prototype.hasSubStr = function (str) {
  11. return this.toLowerCase().indexOf(str.toLowerCase()) > -1;
  12. };