elixir-lang/elixir — pull request #1690 by bruce (2013-09-06 23:20:29+00:00)
Title: Support String.split with an empty binary as the pattern.

As discussed in #1688, currently the following fails:

iex> String.split "abc", ""
** (ArgumentError) argument error
binary.erl:242: :binary.split/3

These changes add support for an empty binary pattern, piggybacking on
the empty regular expression split (vs using `String.graphemes`,
notably) so that the function continues to support the `:global`
option.

Users should probably be using `String.graphemes` for splitting, but
this keeps the API consistent while fixing this exception.

Closes #1688.