Node.js examples for String:String Start
Remove specified characters from start and end of string.
String.prototype.strip = function(characters) { // summary://from w ww . j a v a 2s .co m // Remove specified characters from start and end of string. // param: characters // String of characters to remove. return this.replace(new RegExp('(^[' + characters + ']+)|([' + characters + ']+$)', 'g'), ''); };