Join Harrison Ferrone for an in-depth discussion in this video Use strings, part of Learning Swift 3 for Developers.
- [Instructor] Make some room underneath our number section,…and put in a new comment.…/* Using Strings */.…There are a few different syntaxes for declaring strings.…So let's start by looking at how to declare an empty one.…Let's have a new variable called imEmpty…and we'll set it equal to an empty string,…which is just two pairs of quotes.…We can also declare an empty string…by using the actual string class.…
Variable imAlsoEmpty = String ().…However, if we wanted to just have a place-holder variable,…we could do that.…Declare variable againEmpty: String.…The again empty variable can be assigned…a value at any time.…Like numbers, we can also initialize strings…with values right off the bat, and, of course,…take advantage of the compiler's type inference.…
Let's have a new variable called firstName…of type String and have it equal to Harrison.…Let's also have a lastName variable…equal to Ferrone without the string type.…One of the great things about Swift as a language…is that it's very intuitive.…So, for instance, if I wanted to make a new string…
- Starting a new playground
- Printing to the console
- Declaring variables
- Working with numbers
- Using strings
- Breaking down optionals
- Understanding closures
- Classes vs. structs
- Extensions and protocols
Skill Level Beginner
1. Hello Swift
2. Back to Basics: Variables and Operators
3. Collections, Tuples, and Enumerations
4. Working with Logic Flows
5. Only in Swift: Optionals
6. Functions, Closures, and Associated Types
7. Classes vs. Structs
8. Advanced Topics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.