Last active
October 15, 2018 18:56
-
-
Save backupbrain/ddc26a0298d6fc0f6a47be4c32809b5a to your computer and use it in GitHub Desktop.
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
Tokenizer.prototype.trimWhitespace = function(text) { | |
cleanedText = text.replace(/\n+/g, "\n"); | |
cleanedText = cleanedText.replace(/[ ]+/g, " "); | |
cleanedText = cleanedText.trim(); | |
return cleanedText; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment