Erlang – atom_to_binary

Erlang atom_to_binary

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

This Post Has 2 Comments

Leave a Reply