StringFormatter

class StringFormatter(out: StringBuilder = StringBuilder(), locale: KalugaLocale = defaultLocale)

Formats a given String using a printf-style format strings. Supports formats for Number, String, Char, Boolean, and com.splendo.kaluga.base.utils.KalugaDate. Custom formatting is supported by implementing Formattable. Flags, precision and width are supported by this formatter as well. Formatting will adjust for a provided KalugaLocale. May throw a StringFormatterException if the incorrect format is applied.

Parameters

out

he StringBuilder used for outputting the result.

locale

The KalugaLocale used for formatting. This is relevant for number and date formatting, as well as capitalization.

Constructors

Link copied to clipboard
constructor(out: StringBuilder = StringBuilder(), locale: KalugaLocale = defaultLocale)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun format(format: String, vararg args: Any?): StringBuilder

Formats a String using a printf-style format String and a variable number of arguments.