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

Erlang Binary split_binary Method

Binary Files in Erlang

This method is used to split the binary list according to the specified index position.

Syntax

split_binary(binarylst,index)

Parameter

  • binarylst −This is the binary list that needs to be split.

  • index −This is the index position where the list should be split.

Return Value

Return the split binary string.

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

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

{<<1,2,3>>>,<<4,5>>}

Binary Files in Erlang