Erlang: How does one avoid Lists being translated

2019-07-07 04:38发布

[97, 98, 99]. yields "abc", in the Erlang shell. I realize this is because the ASCII values of a, b and c are 97, 98 and 99 respectively.

So.. how would one go about returning [97,98,99] without Erlang translating it to ASCII?

2条回答
2楼-- · 2019-07-07 05:18

Try this

YourList ++ [0]

With "abc"

"abc" ++ [0]

[97,98,99,0]

查看更多
三岁会撩人
3楼-- · 2019-07-07 05:19

You can try io:format("~w~n", [ListHere]), which should simply avoid interpreting the data.

查看更多
登录 后发表回答