Uppercase and Lowercase regonised the as the same.
I want to be able to put in a word which can be either Title Case, Lower Case, Upper Case or whatever and still be recognised the same way when it is time compare the word to another.
So in my program I have hard-coded Visual Basic and if a user types in ViSuAl BaSiC it will still match provided the spelling is the same, of course :rolleyes: .I know the ToUpper() and ToLower() commands but I don't think they would be used in a soultion. Could someone please point me in the right direction? Thanks. :thumb:
Re: Uppercase and Lowercase regonised the as the same.
Please explain why you don't want to use the ToUpper() or ToLower() functions.
Re: Uppercase and Lowercase regonised the as the same.
Oh, because I want the text to be compared to the hard coded text in the program without the user seeing it. Will ToUpper() and ToLower() convert a string before it is compared without changing anything in the textbox? I imagine it much as the CInt function. If it does then I will try implement a solution straight away, and I already know what code I can use.
Re: Uppercase and Lowercase regonised the as the same.
VB Code:
If MyTextBox.Text.ToLower().Equals("yomammaisaho") then
'
End If
will not alter whatever is in the textbox, it will only return a lowcase string.
Re: Uppercase and Lowercase regonised the as the same.
How about:
[Highlight=VB]
Const sHardCode as String = "VISUAL BASIC"
...
If Textbox1.Text.ToUpper = sHardCode then
...
Re: Uppercase and Lowercase regonised the as the same.
yeah, thats exactly the code i was thinking of except the sHardCode part :D