선언 +
let first = "Hello, " let second = "world" let greeting = first + second |
더블 쿼테이션
let quote = "Then he tapped a sign saying \"Believe\" and walked away." |
문자열에 다른 변수를 포함
let name = "Taylor" let age = 26 let message = "Hello, my name is \(name) and I'm \(age) years old." print(message) |
* \(변수) : 값이 아니라 변수자체를 참조
print("5 x 5 is \(5 * 5)")
숫자를 문자로 변환
let number = 11 let missionMessage = "Apollo " + String(number) + " landed on the moon." |