Ad
Code
Diff
  • public static class Kata
    {
    		public static int SameCase(char a, char b) {
    			bool areBothCharsLetter = char.IsLetter(a) && char.IsLetter(b);
    			bool areSameLetters = char.IsUpper(a) == char.IsUpper(b);
    
    			if (areBothCharsLetter)
    			{
    				if (areSameLetters)
    				{
    					return 1;
    				}
    				else
    				{
    					return 0;
    				}
    			}
    
    			return -1;
    		}
    }
    • public static class Kata
    • {
    • public static int SameCase(char a, char b) =>
    • char.IsLetter(a) && char.IsLetter(b) ?
    • (char.IsUpper(a) == char.IsUpper(b) ? 1 : 0)
    • : -1;
    • public static int SameCase(char a, char b) {
    • bool areBothCharsLetter = char.IsLetter(a) && char.IsLetter(b);
    • bool areSameLetters = char.IsUpper(a) == char.IsUpper(b);
    • if (areBothCharsLetter)
    • {
    • if (areSameLetters)
    • {
    • return 1;
    • }
    • else
    • {
    • return 0;
    • }
    • }
    • return -1;
    • }
    • }