It seems that the only way to do this at low cost ...
# anko
y
It seems that the only way to do this at low cost is to use
SpannableStringBuilder
, which is stateful by its nature. Maybe something like this?
Copy code
buildSpannableString {
    append(“A”, Bold)
    append(“B”, Bold, Italic)
    append("C")
}
This is consistent with the
buildString()
function in Kotlin stdlib. This introduces state, but only inside the lambda, so the state is quite local.