Node.js examples for String:Replace
Replace tab in a String
String.prototype.adjustTab = function() { var pattern = /[\t]+/g; var tabStripped = this.replace(pattern, " "); if (tabStripped.charAt(0) == " ") { return tabStripped.substring(1); }//w w w. j ava2 s. c om return tabStripped; }