Checking characters

  • Thread starter Thread starter Xarky
  • Start date Start date
X

Xarky

Hi,
I need to check that a character stored in a string is an alphabet
character (upper case or lower case is the same). Is there an easy
way to do it?


Thanks in Advance
 
Xarky said:
I need to check that a character stored in a string is an alphabet
character (upper case or lower case is the same). Is there an easy
way to do it?

What *exactly* do you mean by "alphabet character"? Would characters
with accents count? If so, use Char.IsLetter. If not, use

if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
 
Back
Top