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

Erlang Atom binary_to_atom Method

Erlang Atom

This method is used to convert binary values to atom values.

Syntax

binary_to_atom(binaryvalue)

Parameter

  • binaryvalue −This is the binary value that needs to be converted to an atom value.

Return Value

Atom based on binary value.

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

Output Result

The output of the above program is as follows.

‘Erlang’

Erlang Atom