Erlang - list_to_tuple 方法
该方法是将列表转换为元组。
语法
list_to_tuple(list)
参数
list − 这是需要转换为元组的列表。
返回值
根据提供的列表返回一个元组。
例如
-module(helloworld). -export([start/0]). start() -> io:fwrite("~w",[list_to_tuple([1,2,3])]).
输出
上述程序的输出如下
{1,2,3}
该方法是将列表转换为元组。
list_to_tuple(list)
list − 这是需要转换为元组的列表。
根据提供的列表返回一个元组。
-module(helloworld). -export([start/0]). start() -> io:fwrite("~w",[list_to_tuple([1,2,3])]).
上述程序的输出如下
{1,2,3}
如果您发现内容有误或提出修改建议,请随时向我们发送 E-mail 邮件:
421660149@qq.com
您的建议已发送到 W3schools。