I\'ve heard that using StringBuilder is faster than using string concatenation, but I\'m tired of wrestling with StringBuilder objects all of the time. I was recently exposed t
Although the Accepted answer is good, if (like me) one is interested in exactly Slf4J-style semantics, then the correct solution is to use Slf4J's MessageFormatter
Here is an example usage snippet:
public static String format(String format, Object... params) {
return MessageFormatter.arrayFormat(format, params).getMessage();
}
(Note that this example discards a last argument of type Throwable
)