format

fun String.format(vararg args: Any?): String

Uses this string as a JVM-style format string and substitutes args.

The implementation lives entirely in common code. It supports general (b, h, s), character (c), integral (d, o, x), floating-point (e, f, g, a), percent (%), and newline (n) conversions, including their upper-case variants, argument indexes, relative argument reuse, flags, width, and precision.

Formatting uses ROOT-like, locale-independent punctuation and case rules. Unicode casing follows the data available on the target runtime. %n always emits LF. Java-only values and date/time conversions are unsupported. When a target erases runtime numeric identities, ambiguous numbers use conversion-directed Int-or-Double semantics. %s and %h delegate to the target value's Kotlin toString and hashCode, respectively.

Throws

when the format or an argument is invalid.


fun String.Companion.format(format: String, vararg args: Any?): String

Formats format with args using KiteCore's portable JVM-style formatter.

This companion extension provides the familiar String.format(...) call shape in common Kotlin. See String.format for the supported conversions and portability contract.

Throws

when the format or an argument is invalid.