Posted at

KotlinでString.formatを使う

More than 3 years have passed since last update.

Javaでいうこれは

String.format("this is %s format string", "a")

// => this is a format string

Kotlinではこう書く。

"this is %s format string".format("a")

// => this is a format string