Erlang - byte_size
This method returns the number of bytes contained in a Bitstring.
Syntax
byte_size(bitstring)
Parameters
bitstring − This is the btistring for which the number of bytes need to be determined.
Return Value
The method returns the number of bytes contained in a Bitstring.
For example
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[byte_size(<<1,2,3>>)]).
Output
When we run the above program we will get the following result.
3
erlang_bifs.htm
Advertisements