- 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=1739124293-eiYQXXSrP2j7PpY4o9AjlGDS3CjNE7Xy-0-92a4ab743737757c0ca54c1bd321b977)
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.