transformToSpannable

fun <T> Iterable<T>.transformToSpannable(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "…", transform: SpannableStringBuilder.(T) -> Unit): Spannable

Converts the receiver Iterable to a Spannable.

Parameters

separator

separates items.

prefix

the prefix of the generated Spannable.

postfix

the postfix of the generated Spannable.

limit

the maximum number of items transformed.

truncated

the truncation indicator added to the Spannable when the limit is reached.

transform

a lambda function yielding SpannableStringBuilder as its receiver. It is called for each item. The caller function is responsible for adding the text to the builder.