该方法返回特定字符串的长度
len(str)
str - 这是需要确定字符数的字符串。
返回值是字符串中的字符数。
-module(helloLearnfk). -import(string,[len/1]). -export([start/0]). start() -> Str1="This is a string1", Len1=len(Str1), io:fwrite("~p~n",[Len1]).
当我们运行上述程序时,我们将得到以下输出。
链接:https://www.learnfk.comhttps://www.learnfk.com/erlang/erlang-len.html
来源:LearnFk无涯教程网
17
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)