String format

Is it possible to use in rules something like String.format(“text %s and %s”, var1, var2)?
What must be included at the top etc.?

It’s possible but you need to use String::format