What will be the value of message variable when printed ?

var message = "Apple is my favorite fruit"                //Line 1
message.replacingOccurrences(of: "Apple", with: "Mango")  //Line2
print(message)

 

Error in Line 1 as datatype of message variable is not declared
Error in Line 2 as “replacingOccurrences” method is invalid
Mango is my favorite fruit
Apple is my favorite fruit
Verified Answer
Correct Option - d

To get all Infosys Certified iOS Swift App Developer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram