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

Erlang Map is_key Method

Erlang Map

This method is used to determine whether a specific key is defined as a key in the map

Syntax

Is_key(key,map)

Parameter

  • key −If this is the key in the map, then this is the key that needs to be determined.

  • map −This is the map in which the key needs to be searched.

Return Value

If the key is found, it returns true; otherwise, it returns false.

-module(helloworld). 
-export([start/0]). 
start() -> 
   Lst1 = [{"a",1},{"b",2},{"c",3}], 
   Map1 = maps:from_list(Lst1), 
   io:fwrite("~p~n",[maps:is_key("a",Map1).

Output Result

The output of the above program is as follows.

true

Erlang Map