...
Code Block | ||
---|---|---|
| ||
// Fails for supplementary or combining characters public static String trim_bad1(String string) { char ch; for (int i = 0; i < string.length(); i += 1) { ch = string.charAt(i); if (!Character.isLetter(ch)) { break; } } return string.substring(i); } |
...