Core Function BinaryStartsWith
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> BinaryStartsWith( <binary-array>, <binary-array2> ) </pre> === Description === Check if this binary variable starts with a specific sequence of bytes. === Parameters ===...") |
m (1 revision) |
(One intermediate revision by one user not shown) |
Latest revision as of 12:37, 14 June 2015
BinaryStartsWith( <binary-array>, <binary-array2> )
Contents |
Description
Check if this binary variable starts with a specific sequence of bytes.
Parameters
binary-array
The binary variable to check.
binary-array2
The binary variable to compare with.
Return Value
Success: Returns true.
Failure: Returns false.
Remarks
The comparison is case-sensitive.
The bytes are read as ASCII only.
Example
my $bin1 = Pack("A*", "Hello world!"); my $bin2 = Pack("A*", "Hello"); if(BinaryStartsWith($bin1, $bin2)) { say "True"; } else { say "False"; }