String.prototype.RTrim = function (c) {
if (!c) {
c = ' ';
}
var reg = new RegExp('([' + c + ']*$)', 'gi');
return this.replace(reg, '');
}


附其他:
function trim(str){  //删除左右两端的空格
   return str.replace(/(^\s*)|(\s*$)/g, "");
 }
 function ltrim(str){  //删除左边的空格
 return str.replace(/(^\s*)/g,"");
 }
 function rtrim(str){  //删除右边的空格
   return str.replace(/(\s*$)/g,"");
 }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2021-08-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案