Strings & Templates

Text, and how to build it

A String is text: characters between double quotes, like "Mochi". PawWalk is full of them β€” dog names, walker bios, neighborhood names, error messages.

The single most-used String feature in Kotlin is the string template: put $name inside the quotes, and Kotlin drops that value into the text right there. For anything more than a bare name β€” a calculation, a property access β€” wrap it in braces: ${expr}.

You will type $name constantly in this course. It's how almost every label in the PawWalk UI gets its text.