Here you can find the source of startsWithIgnoreCase(final String base, final String start)
Parameter | Description |
---|---|
base | the base string. |
start | the starting text. |
public static boolean startsWithIgnoreCase(final String base, final String start)
//package com.java2s; //License from project: LGPL public class Main { /**/*ww w . j a va 2 s .c om*/ * Helper functions to query a strings start portion. The comparison is case insensitive. * * @param base the base string. * @param start the starting text. * * @return true, if the string starts with the given starting text. */ public static boolean startsWithIgnoreCase(final String base, final String start) { if (base.length() < start.length()) { return false; } return base.regionMatches(true, 0, start, 0, start.length()); } public static int length(String str) { if (str == null) return 0; return str.length(); } }