I have a winform application and I was wondering what is the c# code to validate both lowercase and uppercase input for string search comparison.Thank you.
Asked
Active
Viewed 2,692 times
1 Answers
3
One way is to use the method in the string
class ToUpper()
or ToLower()
before validation.
Something like
string inputString = "inputfoo";
if (inputString.ToUpper() == "INPUTFOO"){
//do something, this is going to be executed
}
you can also check ToLower()
, ToLowerInvariant
, and ToUpperInvariant
methods for further choices.

Ian
- 30,182
- 19
- 69
- 107
-
Thank you for your kindness Ian. – Dominique1256 Dec 15 '15 at 12:03