如何从数字列表中获取字符串? [英] How to get a string from a list of numbers?
本文介绍了如何从数字列表中获取字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Erlang符号列表: [104、105、106、107 ...]
。如何从此列表中获取字符串: hijk ...
?
I have an Erlang list of symbols: [104, 105, 106, 107 ...]
. How can I get a string from this list: "hijk..."
?
推荐答案
作为数据类型的字符串在Erlang中不存在。 ing只是字符列表。
Strings as a datatype do not exist in Erlang. Stings are simply lists of characters.
[104,105,106,107]
和 hijk
是完全等效的。
实际上,如果您在shell中键入原始列表,则会得到字符串:
In fact, if you type the original list in the shell you get back the "string":
1> [104, 105, 106, 107].
"hijk"
这篇关于如何从数字列表中获取字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文