7 Strings

In programming, textual data is represented by strings – ordered sequences of characters. You have already used Kotlin’s strings, like the string you formatted and displayed in SimVillage:

    "Welcome to SimVillage, Mayor! (copyright 2018)"

In this chapter you will see more of what strings can do, using a variety of functions for the String type from the Kotlin standard library. In the process, you will upgrade NyetHack’s tavern to allow customers to order from the menu, an essential feature of any tavern worth its salt.

Get Kotlin Programming: The Big Nerd Ranch Guide, First Edition 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.