Right trim a string with regex - Node.js String

Node.js examples for String:Trim

Description

Right trim a string with regex

Demo Code

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

Related Tutorials