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

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

Description

starts With Ignore Case

License

Apache License

Declaration

public static boolean startsWithIgnoreCase(String str, String prefix) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static boolean startsWithIgnoreCase(String str, String prefix) {
        if (str == null || prefix == null) {
            return false;
        }// w ww.  j a  va2 s  .  com

        final int len = prefix.length();
        if (str.length() < len) {
            return false;
        }

        return str.regionMatches(true, 0, prefix, 0, len);
    }
}

Related

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