如何将字符串前后的空白去除


如何将字符串前后的空白去除


String.prototype.trim=function(){ return this.replace(/(^\s*)(\s*$)/g, ”);}运用示例如下:
【如何将字符串前后的空白去除】

    猜你喜欢