Often times, we find ourselves needing to insert values into a string. In these cases, we can use string interpolation.
In Swift, to insert a value into a string using string interpolation, we can write the value in parentheses, and write a backslash
\ before the parentheses.
var albums = 17 print("Daniel Johnston made \(albums) studio albums.")
It will output:
Daniel Johnston made 17 studio albums.
Inside String.swift, declare a variable called
age and set it equal to your age.
age set up, use
print() and string interpolation to output:
I am [age] years old.
[age] should be the value of the variable