Core Function BinaryStripNull

From Sputnik Wiki
Jump to: navigation, search
BinaryStripNull( <binary-array> )

Contents

Description

Strip all NULL bytes (0x00) from a binary variable.

Parameters

<binary-array>

The binary variable to use.

Return Value

Success: Returns amount of nulls removed.

Failure: Returns 0.

Remarks

If this binary variable had a text encoding stored it will now be wiped.

Example

$a = BinaryCreate(6);
$a[0] = 'T';
$a[2] = 'A';
printr $a;
BinaryStripNull($a);
printr $a;
# Prints
# {BINARY:6}
# {
#         [0] => 84
#         [1] => 0
#         [2] => 65
#         [3] => 0
#         [4] => 0
#         [5] => 0
# }
# {BINARY:2}
# {
#         [0] => 84
#         [1] => 65
# }
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox