TStringUtil extends StringUtils { public static List<String> recursiveSplit(String str, String splitor) { List<String> re = new ArrayList<String>(); String[] strs = twoPartSplit(str, splitor); if (strs.length == 2) { re.add(strs[0]); re.addAll(recursiveSplit(strs[1], splitor)); } else { re.add(strs[0]); } return re; }  static String getBetween(String sql, String start, String end); static String removeBetween(String sql, String start, String end); static String[] twoPartSplit(String str, String splitor); static List<String> recursiveSplit(String str, String splitor); static String fillTabWithSpace(String str); static boolean startsWithIgnoreCaseAndWs(String searchIn, String searchFor); static boolean startsWithIgnoreCaseAndWs(String searchIn, String searchFor, int beginPos); static boolean startsWithIgnoreCase(String searchIn, int startAt, String searchFor); static String stripComments(String src, String stringOpens, String stringCloses, boolean slashStarComments,
                                       boolean slashSlashComments, boolean hashComments, boolean dashDashComments); static String removeBetweenWithSplitor(String sql, String start, String end); static String removeBetweenWithSplitorNotExistNull(String sql, String start, String end); static boolean isTableFatherAndSon(String fatherTable, String sonTable);  }
@Test public void testRecursiveSplit() { Assert.assertEquals(TStringUtil.recursiveSplit("abc:bc:bc", ":"), Arrays.asList("abc", "bc", "bc")); Assert.assertEquals(TStringUtil.recursiveSplit("abc:bc", "d"), Arrays.asList("abc:bc")); Assert.assertEquals(TStringUtil.recursiveSplit("abc:bc", ";"), Arrays.asList("abc:bc")); }