Skip to content

Instantly share code, notes, and snippets.

@Gabbrolee
Created August 3, 2021 18:54
Show Gist options
  • Save Gabbrolee/cadd19674642790e91bfce65fca66ece to your computer and use it in GitHub Desktop.
Save Gabbrolee/cadd19674642790e91bfce65fca66ece to your computer and use it in GitHub Desktop.
DAY ONE: STRING INTERPOLATION
//MARKS:- STRING INTERPOLATION
// This is a way of combining variable and constant inside a string
var namee = "Tim McGraw"
var age1 = 25
var latitude1 = 36.166667
"Your name is \(namee), your age is \(age), and your latitude is \(latitude)."
// mathematical operation can be perform in string interpolation as well
"Your age is \(age1) and in 4 years, you will be \(age + 4)"
// output will be Your age is 25 and in 4 years, you will be 29years
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment