Created
June 25, 2012 20:53
-
-
Save iampeterbanjo/2991169 to your computer and use it in GitHub Desktop.
String.removeSpecialCharacters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove special characters from strings | |
// @return {string} | |
String.prototype.removeSpecialCharacters = function (){ | |
return this.replace(/\t|\?|\r/gi,'').replace(/\n|\_|\-/gi,' '); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment