StringUtils { public static String removeStart(final String str, final String remove) { if (remove != null && str.startsWith(remove)) { return str.substring(remove.length()); } else { return str; } } private  StringUtils(); static String removeStart(final String str, final String remove); static String capitalize(String self); static String splitCamelCase(String s); static String[] split(final String str, final char separatorChar); static String dateAsIsoString(Date date); static String timestampAsIsoString(long timestamp); static String slugify(String s); static boolean isNotEmpty(String s); static boolean isEmpty(String s); static String asCsv(String[] strings); static String asCsv(Collection<?> values); static String getLogstashStyleDate(); static String getLogstashStyleDate(long time); static String replaceWhitespacesWithDash(String s); static String toCommaSeparatedString(String... strings); static String removeTrailingSlash(String url); static String sha1Hash(String s); static String bytesToHex(byte[] bytes); static String toHexString(long l); static String deDot(String s); static String reDot(String s);  }
@Test public void testRemoveStart() { assertEquals(StringUtils.removeStart("teststring", "test"), "string"); assertEquals(StringUtils.removeStart("string", "test"), "string"); assertEquals(StringUtils.removeStart("stringtest", "test"), "stringtest"); }