CompareNoCase

Description

This function performs a non case-insensitive comparison of two strings; returns 0 If the strings are identical, negative if str$ is less than str2$ in the alphabetical order, positive if str$ is greater than str2$.

Syntax

 int CompareNoCase(string str$,string str2$);

Arguments

str,str2

are the strings you want to compare.

Return

0 if the strings are identical,

< 0 if string str$ is less than str2$ in the alphabetical order,

> 0 if string str$ is greater than str2$ in the alphabetical order.

Example

string str1$ = "ABC";
string str2$ = "abc";

int compareAbc = comparenocase(str1$,str2$);
compareAbc=; // Will return 0
string str0$ = "ijk";
i0 = CompareNoCase(str0$,"ijk"); i0 =;  //should print out 0
i1 = CompareNoCase(str0$,"ab"); i1 =;  //should print out 1
i2 = CompareNoCase(str0$,"xyz"); i2 =;  //should print out -1
i3 = CompareNoCase(str0$,"IjK"); i3 =;  //should print out 0

See Also

Compare