@Moe - what you've got is good ... but maybe you'd prefer not entering the whole line. You can try something like this instead:
static void Main(string[] args)
{
char ch;
//input character
Console.WriteLine("Enter an UPPER CASE character, or '!' to exit: ");
while ((ch = Console.ReadKey().KeyChar() != '!')
{
if (IsUpper(ch))
Console.WriteLine("Input character is {0}: OK", ch);
else
Console.WriteLine("Input character is {0}: ERROR!", ch);
}
}
This will respond immediately when you enter ANY keystroke. It will exit immediately when you type "!". And it will print "OK" (for an upper case character) or "ERROR!" otherwise.
Relevant documentation (for our peripatetic friend Jeppe Stig Nielsen):
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…