messageFormat

fun String.messageFormat(locale: Locale?, vararg arguments: Any?): String?

Wrapper method around the Java text formatter

Example string format: Name {0} {1}, Age {2}

Return

the interpolated string with the placeholder variables replaced with the arguments values.

In the example above, the result for passing arguments John, Doe, 35 would be: Name John Doe, Age 35

Parameters

locale

this is the Locale to use e.g. Locale.ENGLISH

arguments

this is a variable number of values to replace placeholders in order