此方法用于將項(xiàng)轉(zhuǎn)換為二進(jìn)制。
term_to_binary(term)
term ?這是術(shù)語(yǔ)值,需要將其轉(zhuǎn)換為二進(jìn)制值。
根據(jù)指定的項(xiàng)返回一個(gè)二進(jìn)制值。
-module(helloworld). -export([start/0]). start() -> io:fwrite("~p~n",[term_to_binary("hello")]).
當(dāng)我們運(yùn)行上面的程序時(shí),我們將得到以下結(jié)果。
{<<131,107,0,5,104,101,108,108,111>>}