English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This method is used to check if a specific key exists in the map.
find(key,map)
key −This is the list that needs to be converted to a map.
map −This is the map in which the key needs to be searched.
If a key is found in the map, return the value.
-module(helloworld). -export([start/0]). start() -> Lst1 = [{"a",1},{"b",2},{"c",3}], Map1 = maps:from_list(Lst1, io:fwrite("~p~n",[maps:find("a",Map1).
Output Result
The output of the above program is as follows.
{ok,1}