// do mixed (initial word) case for all-caps strings
if (allCaps) {
boolean inWord = false;
for (int i=0, c=buf.length(); i < c; i++) {
char ch = buf.charAt(i);
if (Character.isLetter(ch)) {
if (inWord && Character.isUpperCase(ch)) {
buf.setCharAt(i, Character.toLowerCase(ch));
}
inWord = true;