Here you can find the source of startsWithIgnoreCase(String searchIn, String searchFor)
Determines whether or not the string 'searchIn' contains the string 'searchFor', dis-regarding case.License
Apache LicenseParameter
Parameter | Description |
---|---|
searchIn | the string to search in |
searchFor | the string to search for |
public static boolean startsWithIgnoreCase(String searchIn, String searchFor)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w . j a va 2 s . co m * <pre> * Determines whether or not the string 'searchIn' contains the string * 'searchFor', dis-regarding case starting at 'startAt' Shorthand for a * String.regionMatch(...) * * From mysql connector-j * </pre> * * @param searchIn * the string to search in * @param startAt * the position to start at * @param searchFor * the string to search for * @return whether searchIn starts with searchFor, ignoring case */ public static boolean startsWithIgnoreCase(String searchIn, int startAt, String searchFor) { return searchIn.regionMatches(true, startAt, searchFor, 0, searchFor.length()); } /** * <pre> * Determines whether or not the string 'searchIn' contains the string * 'searchFor', dis-regarding case. Shorthand for a String.regionMatch(...) * * From mysql connector-j * </pre> * * @param searchIn * the string to search in * @param searchFor * the string to search for * @return whether searchIn starts with searchFor, ignoring case */ public static boolean startsWithIgnoreCase(String searchIn, String searchFor) { return startsWithIgnoreCase(searchIn, 0, searchFor); } }