public String translateUmlauts(String input) {
String out = input.replaceAll("Ö", "OE").replaceAll("ö", "oe").replaceAll("Ä", "AE").replaceAll("ä", "ae").replaceAll("Ü", "UE").replaceAll("ü", "ue")
String[] words = out.split("\\s+");
for(int i = 0; i < s.length; i++) {
words[i] = out.replaceAll("ß", isStringUppercase(words[i]) ? "SS" : "ss");
}
String result = "";
for( int i = 0; i < s.length; i++) {
result += words[i];
if (i < s.length - 1)
result += " ";
}
return result;
}
public boolean isStringUppercase(String input) {
String withoutUmlauts = input.replaceAll("ß|ö|Ö|ä|Ä|ü|Ü", "");
return withoutUmlauts.toUpperCase().equals(withoutUmlauts);
}