来自 Apache Commons
http://commons.apache.org/proper/commons-lang/apidocs/src-html/org/apache/commons/lang3/StringUtils.html:
1337 public static boolean containsIgnoreCase(final CharSequence str, final CharSequence searchStr) {
1338 if (str == null || searchStr == null) {
1339 return false;
1340 }
1341 final int len = searchStr.length();
1342 final int max = str.length() - len;
1343 for (int i = 0; i <= max; i++) {
1344 if (CharSequenceUtils.regionMatches(str, true, i, searchStr, 0, len)) {
1345 return true;
1346 }
1347 }
1348 return false;
1349 }
http://commons.apache.org/proper/commons-lang/javadocs/api-3.0/src-html/org/apache/commons/lang3/CharSequenceUtils.html
187 static boolean regionMatches(CharSequence cs, boolean ignoreCase, int thisStart,
188 CharSequence substring, int start, int length) {
189 if (cs instanceof String && substring instanceof String) {
190 return ((String) cs).regionMatches(ignoreCase, thisStart, ((String) substring), start, length);
191 } else {
192 // TODO: Implement rather than convert to String
193 return cs.toString().regionMatches(ignoreCase, thisStart, substring.toString(), start, length);
194 }
195 }