Ad

.Equals() for the win

Code
Diff
  • public static class Kata 
    {
      public static int SameCase(char a, char b) =>
          !char.IsLetter(a) || !char.IsLetter(b) ? -1 :
          char.IsUpper(a).Equals(char.IsUpper(b)) ? 1 : 0;
    }
    • public static class Kata
    • {
    • public static int SameCase(char a, char b) =>
    • !char.IsLetter(a) || !char.IsLetter(b) ? -1 :
    • char.IsUpper(a) == char.IsUpper(b) ? 1 : 0;
    • char.IsUpper(a).Equals(char.IsUpper(b)) ? 1 : 0;
    • }