Working with Text

Learn how to manipulate text with Kotlin’s advanced features.

We'll cover the following...

We’ve already seen many examples of working with text. After all, it’s not possible to print Hello Kotlin without using a string, or at least it would be very awkward and inconvenient.

String interpolation

First, as we already know, Kotlin provides a nifty println() standard function that wraps the bulkier System.out.println command from Java. But, more importantly, as in many other modern languages, Kotlin supports string interpolation using the ${} syntax. Let’s take an example: ...