Created
August 3, 2021 18:54
-
-
Save Gabbrolee/cadd19674642790e91bfce65fca66ece to your computer and use it in GitHub Desktop.
DAY ONE: STRING INTERPOLATION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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