Replace a new line character by regex - Node.js Regular expression

Node.js examples for Regular expression:Match

Description

Replace a new line character by regex

Demo Code

String.prototype.replaceNewLineChars = function( replacement )
{
  return this.replace( /\n/g, replacement ) ;
}

Related Tutorials