@Test public void testReplace() { String source = "<a>%1</a>%2<c>%3</c>"; String[] values = new String[] { "AAA", "BBB", "CCC" }; String actual = StringUtil.replace("%", source, values); String expected = "<a>AAA</a>BBB<c>CCC</c>"; Assert.assertEquals(expected, actual); values = new String[] { "AAA", "BBB" }; Assert.assertEquals("<a>AAA</a>BBB<c>BBB</c>", StringUtil.replace("%", source, values)); System.out.println(String.format("[CRAFT-ATOM-UTIL] (^_^) <%s> Case -> test replace. ", CaseCounter.incr(2))); }
public static String replace(String prefix, String src, String value) { String[] values = new String[1]; values[0] = value; return replace(prefix, src, values); }
StringUtil { public static String replace(String prefix, String src, String value) { String[] values = new String[1]; values[0] = value; return replace(prefix, src, values); } }
StringUtil { public static String replace(String prefix, String src, String value) { String[] values = new String[1]; values[0] = value; return replace(prefix, src, values); } private  StringUtil(); }
StringUtil { public static String replace(String prefix, String src, String value) { String[] values = new String[1]; values[0] = value; return replace(prefix, src, values); } private  StringUtil(); static String dbc2sbcCase(String src); static String sbc2dbcCase(String src); static String toString(String[] array, String delim); static boolean contains(String[] strings, String string, boolean caseSensitive); static boolean containSubstring(String[] strings, String string, boolean caseSensitive); static int count(String src, String target); static String firstCharToLowerCase(String src); static String firstCharToUpperCase(String src); static String toCurrencyString(String src, Locale locale); static String toCurrencyString(Double src, Locale locale); static String replace(String prefix, String src, String value); static String getReplaceString(String src, String[] values); static String replace(String prefix, String src, String[] values); static String insert(String src, String target, int index); static boolean isEmpty(String str); static boolean isBlank(String str); static boolean isAnyEmpty(String... strings); static boolean isAnyBlank(String... strings); static boolean isAllEmpty(String... strings); static boolean isAllBlank(String... strings); static boolean isAllNotBlank(String... strings); static boolean isAllNotEmpty(String... strings); static boolean isDigitalString(String src); static boolean hasLength(CharSequence src); static boolean hasText(CharSequence str); static String trimAll(String src); static String trimLeading(String str); static String trimTrailing(String str); static String[] split(String str, int num); }
StringUtil { public static String replace(String prefix, String src, String value) { String[] values = new String[1]; values[0] = value; return replace(prefix, src, values); } private  StringUtil(); static String dbc2sbcCase(String src); static String sbc2dbcCase(String src); static String toString(String[] array, String delim); static boolean contains(String[] strings, String string, boolean caseSensitive); static boolean containSubstring(String[] strings, String string, boolean caseSensitive); static int count(String src, String target); static String firstCharToLowerCase(String src); static String firstCharToUpperCase(String src); static String toCurrencyString(String src, Locale locale); static String toCurrencyString(Double src, Locale locale); static String replace(String prefix, String src, String value); static String getReplaceString(String src, String[] values); static String replace(String prefix, String src, String[] values); static String insert(String src, String target, int index); static boolean isEmpty(String str); static boolean isBlank(String str); static boolean isAnyEmpty(String... strings); static boolean isAnyBlank(String... strings); static boolean isAllEmpty(String... strings); static boolean isAllBlank(String... strings); static boolean isAllNotBlank(String... strings); static boolean isAllNotEmpty(String... strings); static boolean isDigitalString(String src); static boolean hasLength(CharSequence src); static boolean hasText(CharSequence str); static String trimAll(String src); static String trimLeading(String str); static String trimTrailing(String str); static String[] split(String str, int num);  }