目录

append

返回一个新列表List3,它由List1的元素后跟List2的元素组成。

语法 (Syntax)

append(List1,List2)

参数 (Parameters)

  • List1 - 第一个值列表。

  • List2 - 第二个值列表。

返回值 (Return Value)

返回一个新列表List3,它由List1的元素后跟List2的元素组成。

例如 (For example)

-module(helloworld). 
-import(lists,[append/2]). 
-export([start/0]). 
start() -> 
   Lst1 = [1,2,3], 
   Lst2 = append(Lst1,[4,5]), 
   io:fwrite("~w~n",[Lst2]).

输出 (Output)

当我们运行上述程序时,我们将得到以下结果。

[1,2,3,4,5]
↑回到顶部↑
WIKI教程 @2018