Here you can find the source of distinctFrom(String string, String other)
static String distinctFrom(String string, String other)
//package com.java2s; //License from project: Apache License public class Main { static String distinctFrom(String string, String other) { if (string.equals(other)) { return 'a' + upcase(string); }/*from w w w . ja va2 s .c o m*/ return string; } public static String upcase(String s) { if (s.isEmpty() || Character.isUpperCase(s.charAt(0))) { return s; } return Character.toUpperCase(s.charAt(0)) + s.substring(1); } }