0
Q:

How do I check if a string contains another string in Swift

let string = "hello Swift"
if string.contains("Swift") {
    print("exists")
}
4

New to Communities?

Join the community