What I'd use is a combination of Character.toLowerCase(ch), Character.toUpperCase(ch), char[] and StringBuilder.