Erlang - sort 方法
对元素列表进行排序。
语法
sort(lst)
参数
Lst − 需要排序的元素列表。
返回值
返回已排序的元素列表。
例如
-module(helloworld).
-import(lists,[sort/1]).
-export([start/0]).
start() ->
Lst1=[5,6,4],
io:fwrite("~p~n",[sort(Lst1)]).
输出
当我们运行上面的程序时,我们将得到以下结果。
[4,5,6]

