toLongString

fun Any.toLongString(description: String, brackets: String = "()", className: String? = null): String

Creates a string like "className(description)", for example "Double(42.0)" Useful e.g. for implementing .toString() override.

Parameters

description

the content to be displayed inside the brackets.

brackets

a two-character string like "{}", default = "()".

className

the string to be displayed before the brackets; default = the class name of this.

Sources

Katlib source
Link copied to clipboard