Project to study Swift
Table of Contents
Create a function that takes an array and a string as arguments and return the index of the string.
Examples:
find_index(["hi", "edabit", "fgh", "abc"], "fgh") ➞ 2
find_index(["Red", "blue", "Blue", "Green"], "blue") ➞ 1
find_index(["a", "g", "y", "d"], "d") ➞ 3
find_index(["Pineapple", "Orange", "Grape", "Apple"], "Pineapple") ➞ 0
Notes:
Don't forget to return the result.
If you are stuck, find help in the Resources tab.
Excercise from: https://edabit.com/challenges/swift
Open the file FindtheIndex.xcodeproj
- Xcode 12.4
- Use iPhone 12 mini as simulator
Daniel Washington Ignacio - danielvertigo@hotmail.com
Click to access my LinkedIn