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

Erlang Atom list_to_atom method

Erlang Atom

This method is used to convert list items to atoms.

Syntax

list_to_atom(listvalue)

Parameter

  • listvalue −This is the list value that needs to be converted to an atom.

Return Value

Atom based on list value input.

-module(helloworld). 
-export([start/0]). 
start() -> 
   io:fwrite("~p~n",[list_to_atom("atom1")]).

The output of the above program is as follows.

atom1

Erlang Atom