<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Is there a reason to make it work only for trailing empty parts but not for all empty parts?<br></span></div><div><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Ahmed Omar <spawn.think@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> Pablo Platt <pablo.platt@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> "erlang-questions@erlang.org" <erlang-questions@erlang.org><br><b><span style="font-weight: bold;">Sent:</span></b> Tuesday, June 28, 2011 1:43 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [erlang-questions] bug in binary:split with
trim?<br></font><br>
<meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv168183020">According to documentation it's not<div><span class="yiv168183020Apple-style-span" style="font-family:Verdana, Arial, Helvetica, sans-serif;"><dt><b>trim</b></dt><dt><b><span class="yiv168183020Apple-style-span" style="font-weight:normal;">Removes</span> trailing<span class="yiv168183020Apple-style-span" style="font-weight:normal;"> empty parts of the result (as does trim in <span class="yiv168183020code yui_3_2_0_2_130926335450077" style="font-family:courier;font-weight:normal;">re:split/3</span>)</span></b></dt>
<dt><b><span class="yiv168183020Apple-style-span" style="font-weight:normal;"><br></span></b></dt></span><div>http://www.erlang.org/doc/man/binary.html#split-2<br>
<br><div class="yiv168183020gmail_quote">On Tue, Jun 28, 2011 at 11:58 AM, Pablo Platt <span dir="ltr"><<a rel="nofollow" ymailto="mailto:pablo.platt@yahoo.com" target="_blank" href="mailto:pablo.platt@yahoo.com">pablo.platt@yahoo.com</a>></span> wrote:<br><blockquote class="yiv168183020gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="color:#000;background-color:#fff;font-family:arial, helvetica, sans-serif;font-size:12pt;"><div>binary:split with the trim option doesn't remove empty results from the beginning of the binary:<br></div>
<div><br></div><div>binary:split(<<"/a/b/">>, <<"/">>, [global, trim]).</div><div>[<<>>,<<"a">>,<<"b">>]</div><div><br></div>
<div>binary:split(<<"//a/b///">>, <<"/">>, [trim, global]).</div><div>[<<>>,<<>>,<<"a">>,<<"b">>]</div><div><br>
</div><div>Is this a bug?</div><div><br></div><div>Thanks</div></div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
http://erlang.org/mailman/listinfo/erlang-questions<br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>- Ahmed Omar<div>http://nl.linkedin.com/in/adiaa</div><div>Follow me on twitter</div><div>
<a rel="nofollow" target="_blank" href="http://twitter.com/#%21/spawn_think">@spawn_think</a></div><br>
</div></div>
</div><meta http-equiv="x-dns-prefetch-control" content="on"><br><br></div></div></div></body></html>