This demo showcases the difference between WordSplit() and JavaScript's built-in Split() method, namely:

Split() divides the input string on each occurrence of a separator character. This is not good for parsing human-entered text, as we all have our own ideosyncrasies when it comes to notation. For example, some of us use two spaces between sentences and others use one. This would lead Javascript's built-in routine to make too many divisions between words, but WordSplit() handles this just fine.

Split() treats the separating string as one single separator, whereas WordSplit() treats it as a list of individual separator characters. You can now split strings by multiple separators in one pass!



Type a sentence and see the difference between the two techniques. You can even specify a different separating unit, too!

Input text

Separators




JavaScript Split():




WordSplit():