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

Erlang List delete Method

Erlang List

Delete an element from the list and return a new list.

Syntax

delete(element,List1)

Parameter

  • Element −The element to be removed from the list.

  • List1 −The first value list.

Return Value

Return the new list after deleting the element.

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

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

[1,3]

Erlang List