String.format
String#format.java
String formated = String.format("I%s.", "Taro");
MassageFormat#format
Message#format.java
String template = "I{0}is.";
String formated = MessageFormat.format(template, "Taro");
Massage Format is much faster.
API | 10,Run 000 times | 100,Run 000 times |
---|---|---|
String#format | 0.2269983S | 1.2679988S |
Message#format | 0.0730008S | 0.2999999S |
Recommended Posts