let arr = ["swift", "c", "c++", "swift", "java"]
if let index = arr.firstIndex(of: "swift") {
print(index)
}
if let index = arr.firstIndex(of: "c++") {
print(index)
}
if let index = arr.firstIndex(of: "php") {
print("index: \(index)")
}
else {
print("not found")
}
/*
run:
0
2
not found
*/