
此方法用于将现有列表转换为二进制列表。
语法
list_to_binary(lst)
参数
Lst −这是需要转换为二进制值的列表。
返回值
返回列表的位串。
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[list_to_binary([1,2,3])]).当我们运行上面的程序时,我们将得到以下结果。
<<1,2,3>>

此方法用于将现有列表转换为二进制列表。
list_to_binary(lst)
Lst −这是需要转换为二进制值的列表。
返回列表的位串。
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[list_to_binary([1,2,3])]).当我们运行上面的程序时,我们将得到以下结果。
<<1,2,3>>