课程: Swift 5 Essential Training
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Understanding strings
- [Instructor] The string class is going to be a constant building block in any Swift application you put together. So we're going to spend a little time understanding its basic features. And the string is literally a collection of characters strung together that can be manipulated, mutated and accessed in various ways. There are also Unicode compliant in Swift and can handle storing special characters. Now let's run through what we already know. We can create string variables without a value by giving them a name. So I'm going to say activeQuest and the string type annotation. Here activeQuest is declared, but not initialized, meaning that the compiler is going to throw us an error if we try and print it out at this point. Now to get around this when you need to initialize a string variable with some kind of empty value, we can just assign it an open and closed set of quotes. And this is largely a style point, but…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
The quest begins: Variables34 秒
-
(已锁定)
Variables and constants3 分钟 6 秒
-
(已锁定)
Type safety and inference3 分钟 11 秒
-
(已锁定)
Logging and commenting1 分钟 58 秒
-
(已锁定)
Swift operators2 分钟 42 秒
-
(已锁定)
Understanding strings5 分钟 13 秒
-
(已锁定)
Working with strings5 分钟 11 秒
-
(已锁定)
Type conversions4 分钟 57 秒
-
(已锁定)
Booleans and logical operators2 分钟 40 秒
-
(已锁定)
Introducing optionals3 分钟 15 秒
-
(已锁定)
Accessing documentation1 分钟 23 秒
-
(已锁定)
Challenge: Player stats45 秒
-
(已锁定)
Solution: Player stats4 分钟 12 秒
-
-
-
-
-
-
-