Here you can find the source of startsWithIgnoreCase(final String str, final String prefix)
public static boolean startsWithIgnoreCase(final String str, final String prefix)
//package com.java2s; //License from project: Apache License public class Main { public static boolean startsWithIgnoreCase(final String str, final String prefix) { return startsWith(str, prefix, true); }//from w ww.j a v a 2s . com public static boolean startsWithIgnoreCase(final String str, final String prefix, final int offset) { if (str == null || prefix == null) { return (str == null && prefix == null); } if (str.length() < offset) { return false; } final String subStr = str.substring(offset); return startsWithIgnoreCase(subStr, prefix); } private static boolean startsWith(final String str, final String prefix, boolean ignoreCase) { if (str == null || prefix == null) { return (str == null && prefix == null); } if (prefix.length() > str.length()) { return false; } return str.regionMatches(ignoreCase, 0, prefix, 0, prefix.length()); } }