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

Bob Ippolito bob@REDACTED
Thu Mar 14 18:47:13 CET 2013


A = <<"abc">>,
B = <<"def">>,
C = <<A/binary, B/binary>>.

Also:
C = iolist_to_binary([A, B]).



On Thu, Mar 14, 2013 at 10:42 AM, wenew zhang <wenewboy@REDACTED> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130314/6bd411e5/attachment.htm>


More information about the erlang-questions mailing list