Strings In Depth12 / 17
Up next

slice with a range

fun main() {
    val s = "abcdef"
    // slice uses an inclusive index range
    println(s.slice(1..3))
    // take from the front, drop from it too
    println(s.take(2) + s.drop(4))
}
What you're solving

take a window with an index range