[erlang-questions] Which is best? string:concat or ++?
Mon May 7 16:02:39 CEST 2012
Thanks for the quick responses, Paul and Fredrik. That's cleared
things up for me (as well as given me another way to accomplish what I
need). Cheers. :-)
On 7 May 2012 14:45, Fredrik Andersson <> wrote:
> I would recommend also looking at
> On Mon, May 7, 2012 at 3:37 PM, Paul Davis <> wrote:
>> 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 <> 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:
>>> Lecturer, Computer Networking: Institute of Technology, Carlow, Ireland.
>>> erlang-questions mailing list
>> erlang-questions mailing list
Paul Barry, w: http://paulbarry.itcarlow.ie - e:
Lecturer, Computer Networking: Institute of Technology, Carlow, Ireland.
More information about the erlang-questions