private static final String FIND = "äÄöÖüÜß";
private static final String REPLACE[] = { "ae", "Ae", "oe", "Oe", "ue", "Ue", "ss" };
private static final Pattern pattern = Pattern.compile("(["+FIND+"])");
public static final String umlauteErsetzen(final String str)
{
String result = str;
Matcher m = pattern.matcher(str);
if(m.find())
{
StringBuffer buffer = new StringBuffer(str.length());
do
{
m.appendReplacement(buffer, REPLACE[FIND.indexOf(m.group())]);
}
while(m.find());
m.appendTail(buffer);
result = buffer.toString();
}
return result;
}