Core Function BinaryStripNull
From Sputnik Wiki
(Difference between revisions)
(→Example) |
(→Remarks) |
||
Line 21: | Line 21: | ||
=== Remarks === | === Remarks === | ||
− | + | If this binary variable had a text encoding stored it will now be wiped. | |
=== Example === | === Example === |
Revision as of 17:48, 27 July 2014
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 # }