本文介绍了Erlang列出单个数字超过8个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 在某些奇怪的方式,所有的数字超过8,单,在列表中变成某种ascii? [8] - > [\b] 请尝试帮助我这个:)解决方案 String 不是Erlang中的数据类型,它只是一个整数列表。但是如果可能,Erlang shell尝试将列表显示为字符串: 1> S = [65,66,67,68,69,70]。 ABCDEF 2> S =ABCDEF。 ABCDEF 3> IO:写(S)。 [65,66,67,68,69,70] ok 4> [65,66]。 AB 5> [65,66,1]。 [65,66,1] in some weird way all the numbers over 8, single, in a list becomes some kind of ascii?[8] -> ["\b"]Please try to help me with this one :) 解决方案 String is not a data type in Erlang, it's just a list of integers. But Erlang shell try to display lists as strings if possible:1> S = [65, 66, 67, 68, 69, 70]."ABCDEF"2> S = "ABCDEF"."ABCDEF"3> io:write(S).[65,66,67,68,69,70]ok4> [65, 66]."AB"5> [65, 66, 1].[65,66,1] 这篇关于Erlang列出单个数字超过8个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-19 02:44