<div dir="ltr">The redoubtable @jlouis666 has an excellent blog post about strings that may be of interest: <a href="https://medium.com/@jlouis666/erlang-string-handling-7588daad8f05">https://medium.com/@jlouis666/erlang-string-handling-7588daad8f05</a><div><br></div><div>F.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 18, 2015 at 1:23 PM, Rick Pettit <span dir="ltr"><<a href="mailto:rpettit@vailsys.com" target="_blank">rpettit@vailsys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Generally speaking, you probably want to use binaries these days as they consume far less memory (at least for “large” strings):<div><br></div><div> <a href="http://www.erlang.org/doc/efficiency_guide/advanced.html" target="_blank">http://www.erlang.org/doc/efficiency_guide/advanced.html</a></div><div><br></div><div>That goes for both sending over the wire as well as internally.</div><div><br></div><div>-Rick</div><div><br><div><blockquote type="cite"><div><div class="h5"><div>On Aug 18, 2015, at 3:16 PM, Ben Hsu <<a href="mailto:benhsu@gmail.com" target="_blank">benhsu@gmail.com</a>> wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr">Hello<div><br></div><div>I have a simple question, I know Erlang has strings and binary strings as separate data types, and they're different even if they "look the same" in the console</div><div><br></div><div><div><br>1> io:format(<<"fnord">>).</div><div>fnord</div><div>2> io:format("fnord").</div><div>fnord</div></div><div><br></div><div><div>3> "fnord"==<<"fnord">></div><div>3> .</div><div>false</div></div><div><br></div><div>My question is when you will use each one. Are binary strings used for sending data over the wire, and normal strings used internally? what are the tradeoffs?</div></div></div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br></div></blockquote></div><br></div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>