Avoid converting numbers to characters in erlang

前端 未结 1 362
忘了有多久
忘了有多久 2020-12-06 21:18

I\'m having trouble with erlang converting listed numbers to characters whenever none of the listed items could not also be representing a character.

I am writing a

相关标签:
1条回答
  • 2020-12-06 22:05

    If you look at comments you will see that it is more problem of the way shell prints your data, than the data itself. You logic is wright and I would not change it. You could introduce some use of io:format/2 into you code, but I guess that it would make it harder to use this function in other parts of code.

    Other way around it is changing the shell settings itself. There is shell:strings/1 functions that disables printing lists as stings, and it should do exactly what you want. Just remember to change it back when you finish with your shell stuff, since it could introduce some confusion when you will start using some "string" returning functions.

    0 讨论(0)
提交回复
热议问题