课程: Go Essentials: Concurrency, Connectivity, and High-Performance Apps
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Strings
- [Instructor] Strings and go starts with double quotes. Here we have the variable book assigned to a string, "The color of magic." And we are going to use the FMT printer in to print out the book. Let's run it. And we see that we have the color of magic. When we are going to print the len of the book, how many bytes are in the book, we can use the built-in len function. And we have 19 bytes in the book. We can access the first bite with the square brackets and index zero. In the FMT verb, we are going to do percent V for print any go type and percent T to print type of the verb. When we run this one, you're going to say that it is 84, which is the number for the capital B. And it's a U in eight which in go stands for a byte. In go strings are imutable you see the ID is painting this code in red. And if I'll try to run it, I will get a panic. So you cannot assign to a book. So I'll comment this one out. To get…
内容
-
-
-
-
Numbers and assignments3 分钟 52 秒
-
(已锁定)
Conditionals2 分钟 35 秒
-
(已锁定)
For loops2 分钟 5 秒
-
(已锁定)
Challenge: FizzBuzz57 秒
-
(已锁定)
Solution: FizzBuzz55 秒
-
(已锁定)
Strings2 分钟 59 秒
-
(已锁定)
Challenge: Even-ended numbers55 秒
-
(已锁定)
Solution: Even-ended numbers53 秒
-
(已锁定)
Slices2 分钟 34 秒
-
(已锁定)
Challenge: Find the maximal value12 秒
-
(已锁定)
Solution: Find the maximal value41 秒
-
(已锁定)
Maps2 分钟 37 秒
-
(已锁定)
Challenge: Maps26 秒
-
(已锁定)
Solution: Maps57 秒
-
-
-
-
-
-
-
-