[erlang-questions] can you directly generate a binary from format/2 ?

Bengt Kleberg <>
Fri Apr 17 08:11:21 CEST 2009


Greetings,

There is no such format that I know of.
It would probably be a good idea to just change the list to a binary:

erlang:list_to_binary(io_lib:format("test", [])).


bengt

On Thu, 2009-04-16 at 20:28 -0700, Steve Kirsch wrote:
> io_lib:format("test", []).
> 
> returns the string "test".
> 
> What I'd like is a way to return <<"test">> instead from the output of
> format.
> 
> Is there a format/2 somewhere that returns a binary?
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list