Shouldn't stdlib contain such a function? ```fun C...
# stdlib
m
Shouldn't stdlib contain such a function?
Copy code
fun CharSequence.equalsIgnoreCase(that: CharSequence): Boolean {
    val len = length
    if (that.length != len) return false
    return regionMatches(0, that, 0, len, ignoreCase = true)
}
Dealing with `CharSequence`s is pretty painful in Java, I'd like Kotlin to fix this…
d
Seems it exists for just `String`s. (To save other people from searching)
m
Yep, but I'm, gonna have at least
ConcatStr(left: CharSequence, joiner: Char, right: CharSequence, capitalize: Boolean)
and
Slice(where: CharSequence, from: Int, to: Int)
Or this is bad for data locality and `String`s gonna be seriously faster?
👌 1
j
CharSequence is an interface, the virtuals have proven expensive in native code not long ago. for certain string functions upstream of charsequence use there is specific code to check if it is a String to accelerate as a result of the issues raised.