by @saigowthamr

How to compare two strings in Swift

Home » swift » How to compare two strings in Swift

Swift has a double equals == comparison operator by using that we can compare two strings.

let a = "Hola"
let b = "Hola"
let isEqual = (a == b)

print(isEqual)

Output:

true