Nodejs String Trimming Right rtrim()

Here you can find the source of rtrim()

Method Source Code

String.prototype.rtrim = function() {
   return this.replace(/(\s*$)/g, "");
}

Related

  1. rtrim()
    String.prototype.rtrim = function() {
        return this.replace(/\s+$/,"");
    };
    
  2. rtrim()
    String.prototype.rtrim = function() {
        return this.replace(/\s+$/ig, "");
    String.prototype.ltrim = function() {
      return this.replace(/^\s+/ig, "");
    
  3. rtrim()
    String.prototype.rtrim = function() {
      return this.replace(/\s+$/g,"");
    
  4. rtrim()
    String.prototype.rtrim = function() {
      return this.replace(/\s*$/g,'');
    
  5. rtrim()
    String.prototype.rtrim=function()
      return this.replace(/(\s*$)/g,'');
    
  6. rtrim()
    String.prototype.rtrim = function() {
      return this.replace(/\s+$/,'');
    
  7. rtrim()
    String.prototype.rtrim = function()
      return this.replace( /\s*$/g, '' ) ;
    
  8. rtrim()
    String.prototype.rtrim = function(){
        var res = this;
        while (res.substring(res.length - 1, res.length) == " ") {
            res = res.substring(0, res.length - 1);
        return res;
    
  9. rtrim()
    String.prototype.rtrim=function()
      {return this.replace(/\s+$/,'');}