What you are looking for is MessageFormat
, which uses a given format and input parameters, e.g.
MessageFormat.format("Some {0}, {1}, {2}", var1, var2, var3);
And as already mentioned, String.format
can still do the job using the alternate syntax, but it is less powerful in functionality and not what you requested.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…