sString1 | (String) First string to be compared. |
---|---|
sString2 | (String) Second string to be compared. |
sParams | [optional] (String) Additional parameters comparison. Entries are in the KeyVal format, for example mode:begin;ic:0;
mode:s;
mode:full; (default) - The two strings are compared for equality. If the strings length is different, then these cannot be equal.
mode:begin; - The beginning portion of the first string is compared with the whole second string. It means that the sString1 begins with the sString2.
mode:system; - It compares whether first string is less/equal/more than the second string. The strings are compared systematically. Application language settings are not taken into account, i.e. the result of the comparison will be the same in all application languages. This function is mainly used for sorting.
mode:locale; - It compares whether first string is less/equal/more than the second string. Strings are compared locally. Application language settings are taken into account, i.e. the result of the comparison may be different in different application languages. This function is mainly used for sorting. ic:n; - (IgnoreCase)
ic:0; (default) - case sensitive text
ic:1; - case insensitive text |
var nRes = Pm.StringCmp("Windows 10", "Windows 10");
// nRes contains 1
nRes = Pm.StringCmp("Windows 10", "Windows");
// nRes contains 0
nRes = Pm.StringCmp("Windows 10", "Windows", "mode:begin;");
// nRes contains 1
nRes = Pm.StringCmp("WINDOWS 10", "Windows", "mode:begin;");
// nRes contains 0
nRes = Pm.StringCmp("WINDOWS 10", "Windows", "mode:begin;ic:1;");
// nRes contains 1
nRes = Pm.StringCmp("Windows 10", "10", "mode:in;");
// nRes contains 1