Good question! The implementation of String.split/3 is such that matches of the splitting pattern are discarded. For instance:
iex(1)> String.split("hello world", ~r/\s/)
["hello", "world"]
iex(2)> String.split("hello\tworld", ~r/\s/)
["hello", "world"]
iex(3)> String.split("hello\nworld", ~r/\s/)
["hello", "world"]
The output doesn't include the whitespace the string was split on, and thus a problem such as "truncate string to x number of words/characters
while preserving whitespace" cannot be easily solved this way.