PDA

View Full Version : remove case sensitivity in my application



kinjalp
23rd February 2012, 06:07
hi all,


i want to remove case sensitivity in my application.Give me any solution for that.

kinjal :confused:

ChrisW67
23rd February 2012, 06:44
Convert everything to upper or lower case. I hope you do not seriously expect a more detailed answer than that.

kinjalp
23rd February 2012, 09:41
I want to check that letter that written is in upper-case or lower-case ???
so how can I check this.???

ChrisW67
23rd February 2012, 10:21
Open the documentation for QString and QChar and read.

kinjalp
24th February 2012, 11:19
yes, you are right but my question is how can I find whether word is in upper or lower???

ChrisW67
25th February 2012, 08:55
yes, you are right but my question is how can I find whether word is in upper or lower???
No, you have had two questions:

i want to remove case sensitivity in my application.Give me any solution for that. (This is loosely a question)
I want to check that letter that written is in upper-case or lower-case ???

Neither asks how to tell if a word is upper or lower case, and both have been answered.

The answer to your latest incarnation of this question is: See the answer to the previous question because everything you need is there. There a more ways to approach this than I have had hot dinners, here are a few:

A string is all upper case if all its letters are upper case. Iterate over the letters checking each until you find a lower case character or run off the end of the string.
A string is all lower case if all of its letters are lower case. Iterate over the letters checking each until you find a upper case character or run off the end of the string.
A string is all upper case if the word is equal to itself converted toUpper().
A string is all lower case if the word is equal to itself converted toLower().
You could approach this with a QRegExp for simple Latin1 strings also.