English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Delete an element from the list and return a new list.
delete(element,List1)
Element −The element to be removed from the list.
List1 −The first value list.
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]