<div dir="ltr"><div><div>If your string is going to be sent over a socket or written to a file, an iolist is always the most efficient: ["Item:{", ItemID, "}"]<br></div>If you must have flat strings, just use ++<br><br></div>Sergej<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 28, 2016 at 8:22 AM, Khitai Pang <span dir="ltr"><<a href="mailto:khitai.pang@outlook.com" target="_blank">khitai.pang@outlook.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
For string concatenation, which one of the following is the most efficient?<br>
<br>
1)<br>
strings:join(["Item:{", ItemID, "}")], ""]<br>
<br>
2)<br>
lists:append(["Item:{", ItemID, "}")])<br>
<br>
3)<br>
"Item:{" ++ ItemID ++ "}"<br>
<br>
Here ItemID is a UUID.<br>
<br>
<br>
Thanks<br>
Khitai<br>
_______________________________________________<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" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>