[erlang-questions] bug in binary:split with trim?

Pablo Platt pablo.platt@REDACTED
Tue Jun 28 14:20:07 CEST 2011


Is there a reason to make it work only for trailing empty parts but not for all empty parts?



________________________________
From: Ahmed Omar <spawn.think@REDACTED>
To: Pablo Platt <pablo.platt@REDACTED>
Cc: "erlang-questions@REDACTED" <erlang-questions@REDACTED>
Sent: Tuesday, June 28, 2011 1:43 PM
Subject: Re: [erlang-questions] bug in binary:split with trim?


According to documentation it's not
trim
Removes trailingempty parts of the result (as does trim in re:split/3)

http://www.erlang.org/doc/man/binary.html#split-2


On Tue, Jun 28, 2011 at 11:58 AM, Pablo Platt <pablo.platt@REDACTED> wrote:

binary:split with the trim option doesn't remove empty results from the beginning of the binary:
>
>
>
>binary:split(<<"/a/b/">>, <<"/">>, [global, trim]).
>[<<>>,<<"a">>,<<"b">>]
>
>
>binary:split(<<"//a/b///">>, <<"/">>, [trim, global]).
>[<<>>,<<>>,<<"a">>,<<"b">>]
>
>
>Is this a bug?
>
>
>Thanks
>_______________________________________________
>erlang-questions mailing list
>erlang-questions@REDACTED
>http://erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
Best Regards,
- Ahmed Omar
http://nl.linkedin.com/in/adiaa
Follow me on twitter
@spawn_think
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110628/80935fbb/attachment.htm>


More information about the erlang-questions mailing list