Java String Starts Wtih startsWith(String str, String prefix, int index)

Here you can find the source of startsWith(String str, String prefix, int index)

Description

starts With

License

Creative Commons License

Declaration

public static boolean startsWith(String str, String prefix, int index) 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean startsWith(String str, String prefix, int index) {
        if (str == null || prefix == null || index < 0 || index >= str.length())
            throw new IllegalArgumentException();
        int endpos = prefix.length() + index;
        if (endpos > str.length())
            return false;
        return str.substring(index, endpos).equals(prefix);
    }//from ww w.j a va  2 s  .  c o  m
}

Related

  1. startsWith(String str, String prefix)
  2. startsWith(String str, String prefix)
  3. StartsWith(String str, String prefix)
  4. startsWith(String str, String prefix, boolean ignoreCase)
  5. startsWith(String str, String prefix, boolean ignoreCase)
  6. startsWith(String str, String start, boolean caseSensitive)
  7. startsWith(String str1Raw, String str2Raw)
  8. startsWith(String string, char... ca)
  9. startsWith(String string, String prefix)