Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

case recognitionhelp please!

Status
Not open for further replies.

mickymoo

Programmer
Apr 4, 2002
23
GB
I have written a named entity recogniser. Is there a method to get the program to recognise whether a character ina txt file is uppercase or lower case. I don't care what letter it is, I just want the program to recognise if a letter is Ucase or Lcase. At the moment I am doing a string comparison from a .txt file, bt there must be a better way than this.

Any thoughts gratefully appreciated
 
Each character has a numeric value associated with it, known as the ASCII value (actually, in recent years it has got bit more complex than this, but we'll go with tradition for now).

Uppercase characters (A-Z) have ASCII values between 65 and 90. And fortunately VB gives us a function to return any given characters ASCII value, so you can write a line something like this:

If Asc(<your_char>) >= 65 and Asc(<your_char>) <= 90 Then
' Character is uppercase
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top