Here you can find the source of startsWith(String str, String prefix, int index)
public static boolean startsWith(String str, String prefix, int index)
//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 }