From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Get BASIC with swift strings

Get BASIC with swift strings

From the course: iOS Development Tips

Get BASIC with swift strings

- [Instructor] A few tips ago, we went under the hood with unicode characters and their relationship to the swift string type. For most that's great theory, but how does it apply to strings on characters? When I started programming back in the 1980s, I had three string functions in Basic. rightString, leftString, and midString. Let's create a simple extension to string that will let you use mid string using string ranges, and then discuss right and left string, equivalents and how these get returned. So go ahead and download the exercise file, and you'll find I embedded a playground at the top here, so go into the playground, and you're not going to need any of the other stuff so I'm going to get rid of it all, and if it hasn't yet make sure that the auto here is set to manually run instead of automatically run. That makes life a lot easier for ya, and let's go up into the code here, and what we did was create an extension, and then under that extension I made one function for you to…

Contents