format

Uses this string as a format string and returns a string obtained by substituting format specifiers in the format string with the provided arguments, using the default locale.

inline fun String.format(vararg args: Any?): String(source)
fun main() {
    val firstName = "John"
    val age = 30
    val formatted = "Hello, %s! You are %d years old.".format(firstName, age)
    println(formatted)
}

Source