Erlang - tuple_to_list 方法

该方法将元组转换为列表。

语法

tuple_to_list(list)

参数

  • Tuple − 这是需要转换为列表的元组。

返回值

根据提供的元组返回一个列表。

例如

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~w",[tuple_to_list({1,2,3})]).

输出

上述程序的输出如下

[1,2,3]

❮ tuples.html