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) { if (str == null || prefix == null) { return false; }//from ww w . ja v a 2 s . c om if (str.startsWith(prefix)) { return true; } if (str.length() < prefix.length()) { return false; } final String lcStr = str.substring(0, prefix.length()).toLowerCase(); final String lcPrefix = prefix.toLowerCase(); return lcStr.equals(lcPrefix); } }