xiejn

原理就是全部大(小)写,代码:

    <script>
        String.prototype.compare = function(str) {
            //不区分大小写
            if(this.toLowerCase() == str.toLowerCase()) {
                return true;
            } else {
                return false;
            }
        }
        alert("ABCDefg".compare("abcdEFG"));
        alert("abc".compare("acd"));
    </script>

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-06-01
  • 2021-09-04
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-18
  • 2022-12-23
  • 2022-02-07
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
相关资源
相似解决方案