Here you can find the source of startsWith(String s, String begin)
public static boolean startsWith(String s, String begin)
//package com.java2s; //License from project: Apache License public class Main { public static boolean startsWith(String s, String begin) { if ((s == null) || (begin == null)) { return false; }/*w w w .ja va 2 s .com*/ if (begin.length() > s.length()) { return false; } String temp = s.substring(0, begin.length()); if (temp.equalsIgnoreCase(begin)) { return true; } else { return false; } } }