Created
July 12, 2019 02:53
-
-
Save oiojin831/95bb3a7ac825bfc9bd67ad2641c43d75 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void main() { | |
// string interpolation | |
// 사전적 의미: 안쪽에 집어넣는다. / 내삽 | |
// 규칙 | |
// 1. expression의 값을 string 안에 넣기 위해서는 `${expression}` 의 형식을 한다. | |
// 2. expression이 identifier 이면 `{}` 를 생략할수 있다. | |
var name = 'eung jin lee'; | |
// 일반적인 expression | |
print('Hello ${1 + 4}'); | |
// expression이 identifier | |
print('Hello ${name}'); | |
// expression이 identifier {} 생략가능 | |
print('Hello again, $name'); | |
// expression | |
print('Hello ${name.toUpperCase()}'); | |
// 하나의 identifier가 아니면 안됨 | |
print('Hello $name.toUpperCase()'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment