You'll always have to use some form of concatenation for this (assuming value1 isn't a constant like you show here).
The way you've written it will implicitly construct a StringBuilder and use it to concatenate the strings. Another method is String.format(String, Object...)1, which is analogous to sprintf
from C. But even with format()
, you can't avoid concatenation.
1 Yes, I know the anchor link is broken.