English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang Binary term_to_binary Method

Binary Files in Erlang

This method is used to convert items to binary.

Syntax

term_to_binary(term)

Parameter

  • term −This is the term value, which needs to be converted to a binary value.

Return 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>>}

Binary Files in Erlang