"Sputnik" help  
Sputnik Help
BinNCaseCmp(<binary1>, <binary2>, <length>, [<position1>], [<position2>], [<count1>], [<count2>])

Description

Performs a case-insensitive binary comparison between two binary strings, <binary1> and <binary2>, based on the specified positions and lengths. The BinNCaseCmp function compares a specified number of bytes (<length>) from the binary strings, ignoring the case of the characters.

Parameters

<binary1> The first binary string to compare.
<binary2> The second binary string to compare.
<length> The number of bytes to compare from both binary strings.
<position1> Optional starting position in <binary1> for the comparison. If not specified, the comparison starts from the beginning of <binary1>.
<position2> Optional starting position in <binary2> for the comparison. If not specified, the comparison starts from the beginning of <binary2>.
<count1> Optional number of bytes to compare from <binary1>. If not specified, the comparison includes the entire <binary1>.
<count2> Optional number of bytes to compare from <binary2>. If not specified, the comparison includes the entire <binary2>.

Return Value

Success: Returns a zero integer (0).
Failure: Returns a negative or positive integer.

Remarks

The BinNCaseCmp function performs a case-insensitive binary comparison between two binary strings. By specifying the positions and lengths, you can compare a specific number of bytes from each binary string, ignoring the case of the characters. If the optional parameters are not provided, the function includes the entire binary strings from the specified positions.

Related

BinCmp, BinCaseCmp, BinNCmp

Example

Example of usage:

say BinCmp(Bin("Hello"), Bin("Hello")); // true
say BinCmp(Bin("Hello"), Bin("HELLO")); // false
say BinCaseCmp(Bin("Hello"), Bin("HELLO")); // true
say BinNCmp(Bin("CatDog"), Bin("CatFox"), 3); // true
say BinNCmp(Bin("CatDog"), Bin("CATFox"), 3); // false
say BinNCaseCmp(Bin("CatDog"), Bin("CATFox"), 3); // true
// PRINTS
// 0
// 32
// 0
// 0
// 32
// 0

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org