erlang/otp — pull request #517 by capflam (2014-10-23 15:23:45+00:00)
Title: Add 'remove_empty_parts' option to binary:split/3

As its name suggest, this option can be used to remove _ALL_ empty parts of the result of a call to binary:split/3.

```erlang
1> binary:split(<<" 1 2 3 ">>, <<$\s>>, [global]).
[<<>>,<<>>,<<"1">>,<<>>,<<"2">>,<<>>,<<"3">>,<<>>,<<>>]
2> binary:split(<<" 1 2 3 ">>, <<$\s>>, [global,trim]).
[<<>>,<<>>,<<"1">>,<<>>,<<"2">>,<<>>,<<"3">>]
3> binary:split(<<" 1 2 3 ">>, <<$\s>>, [global,remove_empty_parts]).
[<<"1">>,<<"2">>,<<"3">>]
```

This could be done with a simple list comprehension on the result, but I think it is a need common enough to justify this patch.