Swift - Data Types
Identify the error in this Swift code related to string value type behavior:
var text1 = "Swift" var text2 = text1 text2 += " Rocks" print(text1)
var text1 = "Swift" var text2 = text1 text2 += " Rocks" print(text1)
text1 to text2 copies the string value.text2 does not affect text1, which remains "Swift".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions