Depending on your actual definition of uppercase, there's a lot of them, just in the Invariant culture, let alone the others, and it varies depending upon your operating system.
This LinqPad query lists 973 (on Win8.1, 873 on Vista, 673 on XP) uppercase characters by my definition, which is the char is invariant to ToUpperInvariant
and not invariant to ToLowerInvariant
:
var UppercaseChars = from i in Enumerable.Range(0, 65536)
let c = (char)i
let u = Char.ToUpperInvariant(c)
let l = Char.ToLowerInvariant(c)
where c == u && u != l
select c;
UppercaseChars.Count().Dump();
String.Join(" ", UppercaseChars).Dump();
The LinqPad query
Obviously you can change this to use CultureInfo.TextInfo.ToUpper
and .ToLower
to obtain the list for any culture available.
Note my "definition" of uppercase misses 33 characters (on Win8.1, 135 on Vista, 306 on XP) that are called uppercase by the Unicode Category, but don't have a lowercase alternative (according to ToLowerInvariant
). However, it also includes 69 characters (on Win8.1, 71 on Vista, 42 on XP) that are not defined as UppercaseLetter by the Unicode Category, but still have a lowercase alternative (again according to ToLowerInvariant
). The latter are some of the characters in the Unicode Categories TitlecaseLetter (not in XP), LetterNumber and OtherSymbol. Vista actually includes 4 characters that are in the Unicode Category LowercaseLetter (ῃ ῳ ⱥ ⱦ).