If the test is required to be done in a single statement, I think
Regex
class may be a better option.
The
IsMatch
method of
System.Text.RegularExpressions.Regex
class can be used as shown below:
if (Regex.IsMatch(treeView2.SelectedNode.Text,"^[A-Z]$")) {
}