English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This method is used to convert items to binary.
term_to_binary(term)
term −This is the term value, which needs to be converted to a binary value.
Returns a binary value based on the specified item.
-module(helloworld). -export([start/0]). start() -> io:fwrite("~p~n",[term_to_binary("hello")]).
When we run the above program, we will get the following result.
{<<131,107,0,5,104,101,108,108,111>>}