Check if 2 strings are equal


I have two strings and want to check if they are equal (if it's the same string).


// String literals
let s1 = "Hello World"
let s2 = "Hello Guys"
// Check they are the same

if s1==s2 {
    print("S1 is the same as S2")
else {
    print("S1 is not the same as S2")


Find answers here

Hi there! Ask Us a Question We are ready to help