How to format a flat string with integers in it in erlang?
问题 In erlang, I want to format a string with integers in it and I want the result to be flattened. But I get this: io_lib:format("sdfsdf ~B", [12312]). [115,100,102,115,100,102,32,"12312"] I can get the desired result by using the code below but it is really not elegant. lists:flatten(io_lib:format("sdfsdf ~B", [12312])). "sdfsdf 12312" Is there a better formatting strings with integers in them, so that they are flat? Ideally, using only one function? 回答1: You flatten a list using lists:flatten