
Swift 5.1 How to change the value of an existing variable?

Make sure the variable you are trying to change has “var” in front of it. Also you can only change the variable if it is of the same type. String -> String Int -> Int
var str = "Hello, playground"
// now you can just call the variable and
// assign with the "=" to change it's value
str = "New Value"