StringUtil { public static String trimLeft (String s, char[] rgTrim) { int nIdx = 0; String strTrim = new String (rgTrim); while (nIdx < s.length () && strTrim.indexOf (s.charAt (nIdx)) >= 0) nIdx++; return s.substring (nIdx); }  static StringBuilder joinAsBuilder(Iterable<?> coll, String strGlue, StringBuilder sb); static StringBuilder joinAsBuilder(T[] rgArray, String strGlue, StringBuilder sb); static StringBuilder joinAsBuilder(int[] rgArray, String strGlue, StringBuilder sb); static StringBuilder joinAsBuilder(Iterable<?> coll, String strGlue); static StringBuilder joinAsBuilder(T[] rgArray, String strGlue); static StringBuilder joinAsBuilder(int[] rgArray, String strGlue); static String join(Iterable<?> coll, String strGlue); static String join(T[] rgArray, String strGlue); static String join(int[] rgArray, String strGlue); static String concat(Object... rgParts); static String toCamelToe(String strOrig); static String toString(Object obj); static String trimLeft(String s, char[] rgTrim); static String trimRight(String s, char[] rgTrim); static String padRight(String s, int nNumTotalChars); static String num2IdStr(int n); static String num2IdStr(long n);  }
@Test public void testTrimLeft () { assertEquals ("test", StringUtil.trimLeft ("test", new char[] { '_' })); assertEquals ("test", StringUtil.trimLeft ("_test", new char[] { '_' })); assertEquals ("test", StringUtil.trimLeft ("__test", new char[] { '_' })); assertEquals ("test", StringUtil.trimLeft ("_#test", new char[] { '_', '#' })); assertEquals ("", StringUtil.trimLeft ("___", new char[] { '_' })); assertEquals ("test_", StringUtil.trimLeft ("_test_", new char[] { '_' })); }