ToLower convert uppercase to lowercase.
Non-alphabetic characters do not make processing.
This function is a bit special. He handles the characters rather than the strings.
The so-called inability to handle strings does not mean that he cannot handle strings, and when he handles them, the string must be handled one character at a time, and the string cannot be processed at once.
Usage: Commonly used to convert strings:
Example 1:
void ToUpper (char *string)
{
if (!string) return;
while (*string)
{
*string = ToUpper (*string);
string++;
}
}
void ToLower (char *string)
{
if (!string) return;
while (*string)
{
*string = ToLower (*string);
string++;
}
}
Example 2:
Used to do string comparisons
Case insensitive, converted to uppercase after comparison
Char C1 = ToUpper (*STR1);
char C2 = toupper (*STR2);
if (C1 > C2) return 1;
else if (C1 < C2) return-1;
else return StrCmp (str1+1, str2+1, sensitive); All the comparisons are judged first, and then all the uppercase letters are finally converted. Call the original comparison function again to process,
Example 3: Fill it up tomorrow,
C function ToLower, with ToUpper