Here you can find the source of startsWith(String str, String start, boolean caseSensitive)
public static boolean startsWith(String str, String start, boolean caseSensitive)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean startsWith(String str, String start, boolean caseSensitive) { if (str == null || start == null) { return (str == null && start == null); }// w w w . ja va2 s. com if (start.length() > str.length()) { return false; } return str.regionMatches(caseSensitive, 0, start, 0, start.length()); } }