"Sputnik" help  
Sputnik Help
BinaryInsert(<binary>, <data>, <index>)

Description

Inserts the specified data into the given binary string at the specified index.

Parameters

<binary> The binary string which the data will be inserted into.
<data> The data to be inserted into the binary string.
<index> Optional index at which the data should be inserted. (Default: 0)

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

The BinaryInsert function allows you to insert data into a binary string at a specified position. It is useful when you need to modify a binary string by adding additional data at a specific location. The function returns true if the insertion is successful, indicating that the data has been inserted into the binary string at the specified index. If the insertion fails, either due to an invalid index or other reasons, it returns false.

Related

Example

Example of usage:

my $a = Bin("Hello World!");
my $i = BinaryIndexOf($a, "Wo");
BinaryInsert($a, "Cat ", $i);
say $a;

// PRINTS
// Hello Cat World!

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org