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

Erlang Map remove method

Erlang Map

This method is used to remove the key-value from the map.

Syntax

remove(key,map)

Parameter

  • key −This is the key that needs to be removed from the map.

  • map −This is the map that needs to remove the key.

Return Value

Return the map with the deleted key

For example

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

Output Result

The output of the above program is as follows-

#{"b" => 2,"c" => 3}

Erlang Map