Java String Starts Wtih startsWithIgnoreCase(String searchIn, String searchFor)

Here you can find the source of startsWithIgnoreCase(String searchIn, String searchFor)

Description

 Determines whether or not the string 'searchIn' contains the string 'searchFor', dis-regarding case. 

License

Apache License

Parameter

Parameter Description
searchIn the string to search in
searchFor the string to search for

Return

whether searchIn starts with searchFor, ignoring case

Declaration

public static boolean startsWithIgnoreCase(String searchIn, String searchFor) 

Method Source Code

//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);
    }
}

Related

  1. startsWithIgnoreCase(String s, String prefix)
  2. startsWithIgnoreCase(String s, String start)
  3. startsWithIgnoreCase(String s, String w)
  4. startsWithIgnoreCase(String searchIn, int startAt, String searchFor)
  5. startsWithIgnoreCase(String searchIn, int startAt, String searchFor)
  6. startsWithIgnoreCase(String seq, String prefix)
  7. startsWithIgnoreCase(String startString, String anotherString)
  8. startsWithIgnoreCase(String str, String prefix)
  9. startsWithIgnoreCase(String str, String prefix)