Padding
The style of padding to use when formatting a value.
Samples
import kotlinx.datetime.*
import kotlinx.datetime.format.*
import kotlin.test.*
fun main() {
//sampleStart
// Defining a custom format that uses various padding rules
val format = LocalDate.Format {
year(Padding.SPACE)
chars(", ")
monthNumber(Padding.NONE)
char('/')
dayOfMonth(Padding.ZERO)
}
val leoFirstReignStart = LocalDate(457, 2, 7)
check(leoFirstReignStart.format(format) == " 457, 2/07")
//sampleEnd
}