@Test public void testTrim_01() { assertEquals("01", "", StringUtil.trim(null, 't')); assertEquals("02", "", StringUtil.trim("", 't')); assertEquals("03", "esting", StringUtil.trim("testing", 't')); assertEquals("04", "estin", StringUtil.trim("testing", 't', 'g')); assertEquals("05", "Testin", StringUtil.trim("Testing", 't', 'g')); assertEquals("06", "Testin", StringUtil.trim("Testing", 't', 'g')); assertEquals("07", "stin", StringUtil.trim("testing", 't', 'e', 'i', 'g')); assertEquals("08", "test", StringUtil.trim("testing", 'i', 'n', 'g')); }
public static String trim(String s, char c) { return ltrim(rtrim(s, c), c); }
StringUtil { public static String trim(String s, char c) { return ltrim(rtrim(s, c), c); } }
StringUtil { public static String trim(String s, char c) { return ltrim(rtrim(s, c), c); }  }
StringUtil { public static String trim(String s, char c) { return ltrim(rtrim(s, c), c); }  static String substr(String string, int from); static String substr(String string, int from, int length); static String zpad(Object obj, int width, String separator); static String zpad(Object obj, int width); static String lpad(Object obj, int width, String separator); static String pad(Object obj, int width); static String pad(Object obj, int width, char padChar); static String pad(Object obj, int width, char padChar, String separator); static String lpad(Object obj, int width); static String lpad(Object obj, int width, char padChar); static String lpad(Object obj, int width, char padChar, String separator); static String rpad(Object obj, int width, String separator); static String rpad(Object obj, int width); static String rpad(Object obj, int width, char padChar); static String rpad(Object obj, int width, char padChar, String separator); static String substring(String string, int from, int to); static String toString(byte[] bytes); static String lchop(String string, String word); static String rchop(String string, String word); static String[] split(String s, String delim); static String[] split(String s, String delim, int numParts); static String trim(String s, char c); static String ltrim(String s, char c); static String trim(String s, char... chars); static String trim(String s, String chars); static String rtrim(String s, char c); static boolean isTrue(String s); static boolean isTrue(String s, boolean dfault); static String getResourceAsString(String path); static InputStream toInputStream(String s); static InputStream toInputStream(String s, String charset); static String fromInputStream(InputStream is); static String fromInputStream(InputStream is, String charset); static String fromInputStream(InputStream is, String charset, int bufsize); static int toInt(String s); static String emptyIfNull(String str); }
StringUtil { public static String trim(String s, char c) { return ltrim(rtrim(s, c), c); }  static String substr(String string, int from); static String substr(String string, int from, int length); static String zpad(Object obj, int width, String separator); static String zpad(Object obj, int width); static String lpad(Object obj, int width, String separator); static String pad(Object obj, int width); static String pad(Object obj, int width, char padChar); static String pad(Object obj, int width, char padChar, String separator); static String lpad(Object obj, int width); static String lpad(Object obj, int width, char padChar); static String lpad(Object obj, int width, char padChar, String separator); static String rpad(Object obj, int width, String separator); static String rpad(Object obj, int width); static String rpad(Object obj, int width, char padChar); static String rpad(Object obj, int width, char padChar, String separator); static String substring(String string, int from, int to); static String toString(byte[] bytes); static String lchop(String string, String word); static String rchop(String string, String word); static String[] split(String s, String delim); static String[] split(String s, String delim, int numParts); static String trim(String s, char c); static String ltrim(String s, char c); static String trim(String s, char... chars); static String trim(String s, String chars); static String rtrim(String s, char c); static boolean isTrue(String s); static boolean isTrue(String s, boolean dfault); static String getResourceAsString(String path); static InputStream toInputStream(String s); static InputStream toInputStream(String s, String charset); static String fromInputStream(InputStream is); static String fromInputStream(InputStream is, String charset); static String fromInputStream(InputStream is, String charset, int bufsize); static int toInt(String s); static String emptyIfNull(String str); static final String EMPTY; }