Here you can find the source of startsWithIgnoreCase(final String stringToCheck, final String prefix)
Code copied from HtmlUnit (src/main/java/com/gargoylesoftware/htmlunit/TextUtil.java) (https://htmlunit.svn.sourceforge.net/svnroot/htmlunit/trunk/htmlunit - commit 5556)
public static boolean startsWithIgnoreCase(final String stringToCheck, final String prefix)
//package com.java2s; //License from project: Apache License public class Main { /**//from w ww . j a v a 2 s .c om * Code copied from HtmlUnit * (src/main/java/com/gargoylesoftware/htmlunit/TextUtil.java) * (https://htmlunit.svn.sourceforge.net/svnroot/htmlunit/trunk/htmlunit - * commit 5556) */ public static boolean startsWithIgnoreCase(final String stringToCheck, final String prefix) { if (prefix.length() == 0) { throw new IllegalArgumentException("Prefix may not be empty"); } final int prefixLength = prefix.length(); if (stringToCheck.length() < prefixLength) { return false; } return stringToCheck.substring(0, prefixLength).toLowerCase().equals(prefix.toLowerCase()); } }