The list of methods to do String Start With are organized into topic(s).
boolean
startWith(String source, String target) start With
if (source.length() < target.length()) {
return false;
String sub = source.substring(0, target.length());
return target.equalsIgnoreCase(sub);
String
startWithAorAn(String str) start With Aor An
if (str.length() == 0)
return str;
if ((!str.toUpperCase().startsWith("A ")) && (!str.toUpperCase().startsWith("AN "))
&& (!str.toUpperCase().startsWith("THE ")) && (!str.toUpperCase().startsWith("SOME "))) {
if ("aeiouAEIOU".indexOf(str.charAt(0)) >= 0)
return "an " + str;
return "a " + str;
return str;
boolean
startWithBOM(byte[] array) Test if the byte array starts with BOM.
if (array.length < 3) {
return false;
if ((array[0] != (byte) 0xEF) || (array[1] != (byte) 0xBB) || (array[2] != (byte) 0xBF)) {
return false;
return true;