Slide 61
Slide 61 text
@skentphd
Kotlin
fun Iterable.joinToString(
separator: CharSequence = ", ",
prefix: CharSequence = "",
postfix: CharSequence = "",
limit: Int = -1,
truncated: CharSequence = "...",
transform: ((T) -> CharSequence)? = null): String { /* Logic */ }
listOf(1, 2, 3, 4).joinToString() // "1, 2, 3, 4"
listOf(1, 2, 3, 4).joinToString(separator = " & ") // "1 & 2 & 3 & 4"
listOf(1, 2, 3, 4).joinToString(prefix = "(", postfix = ")") // "(1, 2, 3, 4)"