Java String Starts Wtih startsWithIgnoreCase(String originalString, String checkPhrase)

Here you can find the source of startsWithIgnoreCase(String originalString, String checkPhrase)

Description

Check if a string starts with another phrase, case-ignored

License

Open Source License

Parameter

Parameter Description
originalString a string
checkPhrase a phrase to compare with

Return

true / false

Declaration

public static boolean startsWithIgnoreCase(String originalString, String checkPhrase) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from   w  w  w. j a v a2  s .  c om
     * Check if a string starts with another phrase, case-ignored
     * @param originalString a string
     * @param checkPhrase a phrase to compare with
     * @return true / false
     */
    public static boolean startsWithIgnoreCase(String originalString, String checkPhrase) {
        if (originalString == null || checkPhrase == null) {
            return false;
        }
        return originalString.toLowerCase().startsWith(checkPhrase.toLowerCase());
    }
}

Related

  1. startsWithIgnoreCase(String haystack, String pattern)
  2. startsWithIgnoreCase(String input, String prefix)
  3. startsWithIgnoreCase(String inputValue, String prefix)
  4. startsWithIgnoreCase(String main, String with)
  5. startsWithIgnoreCase(String name, Iterable patterns)
  6. startsWithIgnoreCase(String p_sStr, String p_sSubStr)
  7. startsWithIgnoreCase(String s, int offset, int end, String lowerCase)
  8. startsWithIgnoreCase(String s, String prefix)
  9. startsWithIgnoreCase(String s, String prefix)