Ad
Code
Diff
  • public class Kata {
    	public static int sameCase(char a, char b) {
    		if ((Character.isLowerCase(a) && Character.isLowerCase(b)) ||
    		    (Character.isUpperCase(a) && Character.isUpperCase(b))) {
    			return 1;
    		}
    		return Character.isLetter(a) && Character.isLetter(b) ? 0 : -1;
    	}
    }
    • public static class Kata
    • {
    • public static int SameCase(char a, char b)
    • {
    • return (char.IsLetter(a) && char.IsLetter(b))
    • ? (char.IsUpper(a) && char.IsUpper(b)) || (char.IsLower(a) && char.IsLower(b))
    • ? 1 : 0
    • : -1;
    • }
    • public class Kata {
    • public static int sameCase(char a, char b) {
    • if ((Character.isLowerCase(a) && Character.isLowerCase(b)) ||
    • (Character.isUpperCase(a) && Character.isUpperCase(b))) {
    • return 1;
    • }
    • return Character.isLetter(a) && Character.isLetter(b) ? 0 : -1;
    • }
    • }