Erlang - binary_to_list



此方法用於將二進位制值轉換為列表。

語法

binary_to_list(binaryvalue)

引數

  • binaryvalue − 需要轉換為列表的二進位制值。

返回值

返回一個列表。

例如

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

start() -> 
   io:fwrite("~p~n",[binary_to_list(<<2,1>>)]).

輸出

執行以上程式後,將得到以下結果。

[2,1]
erlang_binaries.htm
廣告

© . All rights reserved.