I am creating a simple chat bot using swift 3 in Xcode 8, and have been looking for a way to search for a specific word in a string.
For example:
If the user inputs "I would like to have a cup of coffee please."
The program then checks the string for the word "coffee" then finding "coffee" in the string it then returns bool.
I know that you can do this in python:
phrase = "I would like to have a cup of coffee please."
if "coffee" in phrase
print('hi there')
How would you do this in swift 3?
Thanks