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

Erlang Binary list_to_binary Method

Binary Files in Erlang

This method is used to convert an existing list to a binary list.

Syntax

list_to_binary(lst)

Parameter

  • Lst −This is the list that needs to be converted to a binary value.

Return Value

Return the bit string of the list.

-module(helloworld). 
-export([start/0]). 
start() ->    
   io:fwrite("~p~n",[list_to_binary([1,2,3)]).

When we run the above program, we will get the following results.

<<1,2,3>>

Binary Files in Erlang