Java String Starts Wtih startsWithIgnoreCase(String inputValue, String prefix)

Here you can find the source of startsWithIgnoreCase(String inputValue, String prefix)

Description

Tests if this string starts with the specified prefix, ignoring the case sensitive.

License

Open Source License

Parameter

Parameter Description
inputValue the input string to test
prefix the prefix

Return

true if the input string is a prefix; false otherwise.

Declaration

public static boolean startsWithIgnoreCase(String inputValue, String prefix) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    /**//from  www .  ja  v  a 2s  .  co m
     * Tests if this string starts with the specified prefix, ignoring the case sensitive.
     *
     * @param inputValue the input string to test
     * @param prefix the prefix
     * @return {@code true} if the input string is a prefix; {@code false} otherwise.
     */
    public static boolean startsWithIgnoreCase(String inputValue, String prefix) {
        return inputValue.regionMatches(true, 0, prefix, 0, prefix.length());
    }
}

Related

  1. startsWithIgnoreCase(String a, String b)
  2. startsWithIgnoreCase(String baseString, String compareString)
  3. startsWithIgnoreCase(String haystack, String needle)
  4. startsWithIgnoreCase(String haystack, String pattern)
  5. startsWithIgnoreCase(String input, String prefix)
  6. startsWithIgnoreCase(String main, String with)
  7. startsWithIgnoreCase(String name, Iterable patterns)
  8. startsWithIgnoreCase(String originalString, String checkPhrase)
  9. startsWithIgnoreCase(String p_sStr, String p_sSubStr)