You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following simple program shows incorrect result on Kotlin Playground:
val str = "This is not that long a string"
fun main() {
val part = str.substringAfter("is ").substringBefore(" long")
println("Full: $str")
println("Part: $part")
}
Obviously, it should display "not that", but instead it displays "is not that". It seems that substringAfter() includes the delimiter string "is " parameter in its return value, but it should not.
When I run the same code on Android (i.e. JVM), the result is correctly "not that"
The text was updated successfully, but these errors were encountered:
The following simple program shows incorrect result on Kotlin Playground:
Obviously, it should display "not that", but instead it displays "is not that". It seems that
substringAfter()
includes the delimiter string "is " parameter in its return value, but it should not.When I run the same code on Android (i.e. JVM), the result is correctly "not that"
The text was updated successfully, but these errors were encountered: