//去除字符串中间空格
String.prototype.Trim = function() {
return this.replace(/(^\s*)|(\s*$)/g, "");
}
//去除字符串左侧空格
String.prototype.LTrim = function() {
return this.replace(/(^\s*)/g, "");
}
//去除字符串右侧空格
String.prototype.RTrim = function() {
return this.replace(/(\s*$)/g, "");
}
javascript去除字符串中的空格
最新推荐文章于 2022-03-22 15:25:37 发布
