In this Swift Tutorial we will tell you how to get the first word from string sentence in Swift

Before you start please Create or open a Swift Playground and name it “Apps-Top.com Swift Tutorial – How to get the first word from string sentence in Swift”

Follow Along

Let’s create a variable to hold our sentence

Open a swift playground and type:

Now, let’s create a function that will return the first word of our sentence

Now let’s get the first word from our sentence

As a result you will see the following in your playground:

How to get the first word from string sentence in Swift

How to get the first word from string sentence in Swift

Try more Swift tutorials at 👉 Swift Tutorials Navigation

Tutorial made in Swift 3

This lesson is a part of Swift Tutorials and Lessons created by the Apps-Top.com Team. Feel free to save and share this post to social if you find this lesson useful or helpful.