Core Function BinaryStartsWith
From Sputnik Wiki
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"; }