Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Erlang Map keys

-module(helloworld). 
-export([start/0]). 

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

Erlang Map is_key

-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)]).

Erlang get Map

-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)]).

Erlang Map find

-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)]).

Erlang Map from_list

-module(helloworld). 
-export([start/0]). 

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

Erlang Maps

-module(helloworld). 
-export([start/0]). 

start() -> 
   M1 = #{name=>john,age=>25}, 
   io:fwrite("~w",[map_size(M1)]).

Erlang binary_to_atom

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[binary_to_atom(<<"Erlang">>, latin1)]).

Erlang atom_to_binary

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[atom_to_binary('Erlang', utf8)]).

Erlang - list_to_atom

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[list_to_atom("atom1")]).

Erlang atom_to_list

-module(helloworld). 
-export([start/0]). 

start() ->   
   io:fwrite("~p~n",[atom_to_list(atom1)]).

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.