[erlang-questions] Which is best? string:concat or ++?
Mon May 7 15:37:13 CEST 2012
Quick scan of the source shows that string:concat/2 is exactly the ++
operator. So using ++ will save you a function invocation assuming the
Erlang compiler doesn't optimize that away.
On Mon, May 7, 2012 at 8:31 AM, Paul Barry <paul.james.barry@REDACTED> wrote:
> Hi folks.
> This might be a case of a dumb question, but here goes anyway. :-)
> I have two strings, A and B. Is it better to use:
> string:concat(A, B)
> A ++ B
> when combining them to create a new string? I'm writing some code
> that generates a chunk of HTML. I know that using ++ on big lists is
> regarded as a "no-no", but is it acceptable here?
> Paul Barry, w: http://paulbarry.itcarlow.ie - e: paul.barry@REDACTED
> Lecturer, Computer Networking: Institute of Technology, Carlow, Ireland.
> erlang-questions mailing list
More information about the erlang-questions