strniCmp Function
Use
Purpose
Compares the first n characters of two strings for equality (case-insensitive).
Syntax
int strniCmp (in string string1, in string string2, in int numberOfChars)
Parameters
|
string1 |
Expression evaluating to a string. |
|
string2 |
Expression evaluating to a string. |
|
numberOfChars |
Number of characters to compare. |
Return Value
The return value depends on the value of numberOfChars:
|
Condition |
Return Value |
|
If the first numberOfChars characters of string1 are equal to the first numberOfChars characters of string2, regardless of case. |
0 |
|
If the first numberOfChars characters of string1 are less than the first numberOfChars characters of string2, regardless of case. |
<0 |
|
If the first numberOfChars characters of string2 are less than the first numberOfChars characters of string1, regardless of case. |
>0 |
Example
`if (strniCmp(~language, "en", 1) == 0)` English Version: `end`