xinggevip

JS之去掉首尾空格
//去左空格; function ltrim(s){     return s.replace(/^\s*/g,&...
扫描右侧二维码阅读全文
03
2019/07

JS之去掉首尾空格

//去左空格;
function ltrim(s){
    return s.replace(/^\s*/g,"");
}
//去右空格;
function rtrim(s){
    return s.replace(/\s*$/g,"");
}
//去左右空格;将长度大于19位的截取前19位
function trim(s){
        b=rtrim(ltrim(s));
}
Last modification:July 3rd, 2019 at 02:52 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment