Erlang - atom_to_binary



此方法用於將一個原子轉換為一個二進位制值。

語法

atom_to_binary(atom)

引數

  • atom - 需要轉換為二進位制值的原子。

返回值

基於原子值的二進位制值。

例如

-module(helloworld). 
-export([start/0]). 

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

輸出

上述程式的輸出如下。

<<"Erlang">>
erlang_atoms.htm
廣告
© . All rights reserved.