Core Function BinaryStripNull

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> BinaryStripNull( <binary-array> ) </pre> === Description === Strip all NULL bytes (0x00) from a binary variable. === Parameters === ==== <binary-array> ==== The binary...")
 
(Example)
Line 32: Line 32:
 
BinaryStripNull($a);
 
BinaryStripNull($a);
 
printr $a;
 
printr $a;
// Prints
+
# Prints
 
# {BINARY:6}
 
# {BINARY:6}
 
# {
 
# {

Revision as of 16:13, 27 September 2013

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

None.

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