function Trim(str, is_global) {
    var result;
    result = str.replace(/(^\s+)|(\s+$)/g, "");
    if (is_global.toLowerCase() == "g") {
        result = result.replace(/\s/g, "");
    }
    return result;
}
 
//is_global参数为 ‘g’ 默认去掉字符串中所有空格
 
额外小知识:
::-webkit-scrollbar {
        width: 0px;
        /* background-color: red; */
    }
 
控制谷歌浏览器滚动条宽和颜色
posted on 2022-04-27 13:25  热心市民宗某§  阅读(24)  评论(0)    收藏  举报