[erlang-questions] does erlang binary append need to convert to list first?

Bob Ippolito bob@REDACTED
Thu Mar 14 18:48:09 CET 2013


Or more efficiently:
iolist_to_binary(["abc", "def"]).


On Thu, Mar 14, 2013 at 10:47 AM, John Kemp <john@REDACTED> wrote:

> list_to_binary(lists:flatten(["abc","def"])).
>
> ?
>
> JohnK
>
> On Mar 14, 2013, at 1:42 PM, wenew zhang wrote:
>
> > on erl command shell,
> > A=list_to_binary("abc").
> > B=list_to_binary("def").
> > i want A+B convert to <<"abcdef">>
> > now i need do it as below:
> > list_to_binary(binary_to_list(A)++binary_to_list(B)).
> >
> > <<"abcdef">>
> >
> > is there a simple method make A+B in binary type?
> >
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130314/ac12458e/attachment.htm>


More information about the erlang-questions mailing list