Erlang-binaries-binary-to-atom

提供:Dev Guides
移動先:案内検索

Erlang-binary_to_atom

このメソッドは、バイナリ値をアトムに変換するために使用されます。

構文

binary_to_atom(binaryvalue)

パラメーター

  • binaryvalue -これは、アトムに変換する必要があるバイナリ値です。

戻り値

アトムを返します。

例えば

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

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

出力

上記のプログラムを実行すると、次の結果が得られます。

‘Erlang’