Ad
  • Default User Avatar

    First letter check, after it case check. Then you don't need IsUpper.

    public static int SameCase(char a, char b) =>
    !(Char.IsLetter(a) && Char.IsLetter(b)) ? -1 : (Char.IsLower(a) == Char.IsLower(b) ? 1 : 0);