String

A string is a sequence of characters. In Kotlin, strings are represented by the string class. Strings can be easily written by typing out a sequence of characters and surrounding it with double quotation marks:

val martinLutherQuote: String = "Free at last, Free at last, Thank God almighty we are free at last."

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.