有关利用正则去除空格方法
摘要:使用js去除字符串内所带有空格,有以下三种方法: ( 1 ) replace正则匹配方法 去除字符串内所有的空格:str = str.replace(/\s*/g,""); 去除字符串内两头的空格:str = str.replace(/^\s*|\s*$/g,""); 去除字符串内左侧的空格:str
阅读全文
posted @ 2021-04-23 10:01
posted @ 2021-04-23 10:01
posted @ 2020-04-27 12:21