@Test public void testFormat() throws Exception { assertTrue("hahatrue,false,10000,false".equals(StringUtils.format("haha{1},{2},{0},{2}", 10000, true, false, 4))); }
public static String format(String str, Object... arguments) { if (arguments.length == 0) { return str; } for (int i = 0, len = arguments.length; i < len; i++) { str = str.replace(join("{", String.valueOf(i), "}"), String.valueOf(arguments[i])); } return str; }
StringUtils { public static String format(String str, Object... arguments) { if (arguments.length == 0) { return str; } for (int i = 0, len = arguments.length; i < len; i++) { str = str.replace(join("{", String.valueOf(i), "}"), String.valueOf(arguments[i])); } return str; } }
StringUtils { public static String format(String str, Object... arguments) { if (arguments.length == 0) { return str; } for (int i = 0, len = arguments.length; i < len; i++) { str = str.replace(join("{", String.valueOf(i), "}"), String.valueOf(arguments[i])); } return str; }  }
StringUtils { public static String format(String str, Object... arguments) { if (arguments.length == 0) { return str; } for (int i = 0, len = arguments.length; i < len; i++) { str = str.replace(join("{", String.valueOf(i), "}"), String.valueOf(arguments[i])); } return str; }  static boolean isEmpty(final String text); static boolean isNotEmpty(final String text); static boolean isBlank(final String text); static boolean isNotBlank(final String text); static int length(final String text); static String[] split(final String str, final String separatorChars); static String lowerWord(CharSequence cs, char c); static int asciiSizeInBytes(long v); static String join(String... strings); static String build(String delimiter, String prefix, String suffix, String... strings); static byte[] utf8Bytes(CharSequence str); static byte[] bytes(CharSequence str); static byte[] bytes(CharSequence str, Charset charset); static String format(String str, Object... arguments); static String readString(InputStream inputStream); static String readString(InputStream inputStream, Charset charset); static String readString(Reader reader); }
StringUtils { public static String format(String str, Object... arguments) { if (arguments.length == 0) { return str; } for (int i = 0, len = arguments.length; i < len; i++) { str = str.replace(join("{", String.valueOf(i), "}"), String.valueOf(arguments[i])); } return str; }  static boolean isEmpty(final String text); static boolean isNotEmpty(final String text); static boolean isBlank(final String text); static boolean isNotBlank(final String text); static int length(final String text); static String[] split(final String str, final String separatorChars); static String lowerWord(CharSequence cs, char c); static int asciiSizeInBytes(long v); static String join(String... strings); static String build(String delimiter, String prefix, String suffix, String... strings); static byte[] utf8Bytes(CharSequence str); static byte[] bytes(CharSequence str); static byte[] bytes(CharSequence str, Charset charset); static String format(String str, Object... arguments); static String readString(InputStream inputStream); static String readString(InputStream inputStream, Charset charset); static String readString(Reader reader); static final String EMPTY; static final String SPACE; static final String LF; static final String CR; static final String COMMA; static final String[] EMPTY_STRING_ARRAY; }