整理网上的面试题
一、去空格
去除所有空格: str = str.replace(/\s*/g,"");
去除两头空格: str = str.replace(/^\s*|\s*$/g,"");
去除左空格: str = str.replace( /^\s*/, “”);
去除右空格: str = str.replace(/(\s*$)/g, "");
---------------------
作者:wdlhao
来源:CSDN
原文:https://blog.csdn.net/wdlhao/article/details/79079660
版权声明:本文为博主原创文章,转载请附上博文链接!去除所有空格: str = str.replac