.Equals() for the win
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;
- }