Erlang - tuple_to_list



此方法可將元組轉換為列表。

語法

tuple_to_list(list)

引數

  • 元組 - 需要轉換為列表的元組。

返回值

根據提供的元組返回列表。

例如

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

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

輸出

上述程式的輸出如下

[1,2,3]
erlang_tuples.htm
廣告
© . All rights reserved.