In this guide, we will discuss Erlang binary_to_atom. This method is used to convert a binary value to an atom.
Syntax
binary_to_atom(binaryvalue)
Parameters
- binaryvalue − This is binary value which needs to be converted to a atom.
Return Value
Returns an atom.
For example
-module(helloworld). -export([start/0]). start() -> io:fwrite("~p~n",[binary_to_atom(<<"Erlang">>, latin1)]).
Output
When we run the above program we will get the following result.
‘Erlang’
Next Topic : Click Here
Pingback: Erlang - binary_to_list | Adglob Infosystem Pvt Ltd
Pingback: Erlang - Binaries | Adglob Infosystem Pvt Ltd