What am i doing wrong | SoloLearn: Learn to code for FREE!

0

What am i doing wrong

https://code.sololearn.com/c52i1r53uk23/?ref=app

5/16/2020 8:09:31 PM

Joshua Flynn

1 Answer

New Answer

+4

tolowercased is actually a function and you can't compare those two functions like that. You have to actually call them with parenthesis. fixed code: let s1 = "We are alike" let s2 = "We are Alike" if s1 == s2 { print("These two strings are equal") } else if s1.lowercased() == s2.lowercased(){ print("these two strings are similar") } else{ print("these are two different strings")}