English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Check if the element exists in the list.
member(element, lst1)
Element −Element to Search in the List.
Lst1 −Element List.
If the element exists in the list, it returns true; otherwise, it returns false.
-module(helloworld). -import(lists,[member/2]). -export([start/0]). start() -> Lst1=[1,2,3,4], io:fwrite("~w~n",[member(3,Lst1)]).
Output Result
When we run the above program, we will get the following results.
true