Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { public static boolean startWithMytext(String mytext, String begin) { if (TextUtils.isEmpty(mytext) && TextUtils.isEmpty(begin)) return false; else { if (mytext.startsWith(begin)) return true; else return false; } } }