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

wenew zhang wenewboy@REDACTED
Thu Mar 14 18:51:30 CET 2013


thanks all guys,
iolist_to_binary([A, B]) is the best method,

wenew zhang


On 2013-3-15, at 上午1:48, Bob Ippolito <bob@REDACTED> wrote:

> 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/20130315/a34718d7/attachment.htm>


More information about the erlang-questions mailing list