String.to_atom

You're seeing just the function to_atom, go back to String module for more information.

Specs

to_atom(t()) :: atom()

Converts a string to an atom.

Warning: this function creates atoms dynamically and atoms are not garbage-collected. Therefore, string should not be an untrusted value, such as input received from a socket or during a web request. Consider using to_existing_atom/1 instead.

By default, the maximum number of atoms is 1_048_576. This limit can be raised or lowered using the VM option +t.

The maximum atom size is of 255 Unicode code points.

Inlined by the compiler.

Examples

iex> String.to_atom("my_atom")
:my_atom