static void log(String format, Object... args) {
int len = format.length();
int argIndex = 0;
StringBuilder sb = new StringBuilder(len + 20);
Pattern pattern = Pattern.compile("\\{\\}");
Matcher m = pattern.matcher(format);
while (m.find()) {
m.appendReplacement(sb, args[argIndex++].toString());
}
m.appendTail(sb);
System.out.println(sb.toString());
return;
Sign in to make a reply
asdas2333
static void log(String format, Object... args) {
int len = format.length();
int argIndex = 0;
StringBuilder sb = new StringBuilder(len + 20);
Pattern pattern = Pattern.compile("\\{\\}");
Matcher m = pattern.matcher(format);
while (m.find()) {
m.appendReplacement(sb, args[argIndex++].toString());
}
m.appendTail(sb);
System.out.println(sb.toString());
return;
}