Tolower

In C / C++ tolower function converts a given character to lowercase according to the character conversion rules defined by the currently installed C locale. In the default "C" locale, the following uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ are replaced with respective lowercase letters abcdefghijklmnopqrstuvwxyz.

Toupper

In C / C++ toupper function converts a given character to uppercase according to the character conversion rules defined by the currently installed C locale. In the default "C" locale, the following lowercase letters abcdefghijklmnopqrstuvwxyz are replaced with respective uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ.



Comparisons better

Example

"Toupper is better to use than tolower but i forget why"

from question  

How to calculate time complexity of this function which checks if a string has all unique characters?

"And if you have to convert to the same case to make comparisons toupper is better than tolower"

from question  

LINQ case sensitive

Others

Example

So you can t reject the null hypothesis that tolower is as faster as toupper and thus your experiment has got errors

from question  

Why ToUpper is faster than ToLower?

Your intial hypothesis of toupper being faster than tolower has a logical fallacy

from question  

Why ToUpper is faster than ToLower?

As a side note using toupper is more efficient than using tolower so toupper would be the way to go

from question  

Linq: using StringComparer with GroupBy/Distinct in query syntax

So yes - toupper is more reliable than tolower

from question  

What is wrong with ToLowerInvariant()?

You can use string.isnullorempty and toupper method is in general more accurate than tolower

from question  

Finding the word in every line c#

We uppercase this with toupper then we add on the next 3 characters of the string starting at the 4th character which we force in to lower case with tolower

from question  

Validating user entry matches mixed case requirements

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0