- iOS 12 Programming for Beginners
- Craig Clayton
- 94字
- 2021-07-02 15:04:50
String
The first data type we will cover is a string. A series of characters represent a string. Strings are used to display text in an app. A string wrapped in quotes is known as a string literal. In programming, we cannot just add text to Playgrounds. So, to write a string, we must wrap our string inside quotes.
Let's add our name into Playgrounds, wrapped in quotes:
![](https://epubservercos.yuewen.com/2E52D1/19470383901517806/epubprivate/OEBPS/Images/0a584218-d9bb-4d14-a171-3653e522bf6c.png?sign=1738957288-dXVCFsNYX4K8EUTAHq3C7cC4bEsBl3GL-0-0d858db38570e7354680949613246fae)
In Playgrounds, your values appear inside of your Results Panel. So, we now know that in order to create a string, we need to use quotes.