String Methods in Kotlin
Level 298 keystrokes
Shows common string operations: length, uppercase() and lowercase().
Kotlin code
// A string of 12 characters (the space counts too)1val text = "Hello Kotlin"// length returns the number of characters: 122println(text.length)// uppercase() returns HELLO KOTLIN3println(text.uppercase())// lowercase() returns hello kotlin; text itself is unchanged4println(text.lowercase())Output
12 HELLO KOTLIN hello kotlin
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this Kotlin code and how often they appear.
(× 5)× 5.× 3"× 2=× 1