English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This method is used to get the value of a specific key in the map.
get(key,map)
key −This is the key for which the return value is needed.
map −This is the map in which the key needs to be searched.
If the key is found on 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:get("a",Map1)]).
Output Result
The output of the above program is as follows.
1