In this guide, we will discuss Erlang is_binary. This method is used to check if a bitstring is indeed a binary value.
Syntax
is_binary(bitstring)
Parameters
- bitstring − This is bitstring which needs to be checked as to whether it’s a binary or not.
Return Value
Returns true if the bitstring is a binary value, else returns false.
For example
-module(helloworld). -export([start/0]). start() -> io:fwrite("~p~n",[is_binary(<<1,2,3>>)]).
Output
When we run the above program we will get the following result.
true
Next Topic : Click Here
Pingback: Erlang - term_to_binary | Adglob Infosystem Pvt Ltd
Pingback: Erlang - Binaries | Adglob Infosystem Pvt Ltd