当前位置: 首页 > 文档资料 > Erlang 中文教程 >

atom_to_binary

优质
小牛编辑
115浏览
2023-12-01

此方法用于将原子转换为二进制值。

语法 (Syntax)

atom_to_binary(atom)

参数 (Parameters)

  • atom - 需要转换为二进制值的atom。

返回值 (Return Value)

基于原子值的二进制值。

例如 (For example)

-module(helloworld). 
-export([start/0]). 
start() -> 
   io:fwrite("~p~n",[atom_to_binary('Erlang', utf8)]).

输出 (Output)

上述程序的输出如下。

<<"Erlang">>