js清除所有的空格

/**
* 清除所有的空格
* @returns {*}
*/
String.prototype.removeSpace = function () {
var str = this.replaceAll(' ', '').replaceAll(' ', '').replaceAll('\u0026nbsp;', '')
return str
}
posted @ 2017-11-09 14:56    阅读(635)  评论(0编辑  收藏  举报