int (char ch1, char ch2, boolean ignoreCase) { // transitivity fix, otherwise can fail when comparing strings with characters between ' ' and '0' (e.g. '#') if (ch1 == ' ' && ch2 > ' ' && ch2 < '0') return +1; if (ch2 == ' ' && ch1 > ' ' && ch1 < '0') return -1; return Strings.compare(ch1, ch2, ignoreCase); }