English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang List Sort Method

Erlang List

Sort the element list.

Syntax

sort(lst)

Parameters

  • Lst −The list of elements to be sorted.

Return Value

Return the sorted list of elements.

-module(helloworld). 
-import(lists,[sort/1]). 
-export([start/0]). 
start() -> 
   Lst1=[5,6,4], 
   io:fwrite("~p~n",[sort(Lst1)]).

When we run the above program, we will get the following results.

[4,5,6]

Erlang List