In this guide, we will discuss Erlang atom_to_binary. This method is used to convert an atom to a binary value.
Syntax
atom_to_binary(atom)
Parameters
- atom − The atom which needs to be converted to a binary value.
Return Value
A binary value based on the atom value.
For example
-module(helloworld). -export([start/0]). start() -> io:fwrite("~p~n",[atom_to_binary('Erlang', utf8)]).
Output
The output of the above program will be as follows.
<<"Erlang">>
Next Topic : Click Here
Pingback: Erlang - list_to_atom | Adglob Infosystem Pvt Ltd
Pingback: Erlang - Atoms | Adglob Infosystem Pvt Ltd