Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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")}
16th May 2020, 8:18 PM
Raj Chhatrala
Raj Chhatrala - avatar