Elements of String

suggest change

Elements of String are characters that can be accessed by the indexing operation string[index].

val str = "Hello, World!"
println(str[1]) // Prints e

String elements can be iterated with a for-loop.

for (c in str) {
    println(c)
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents