Skip to content

Latest commit

 

History

History
15 lines (14 loc) · 449 Bytes

2-3.Data_Types.String Interpolation.md

File metadata and controls

15 lines (14 loc) · 449 Bytes

Dart

문장에 변수를 사용하는 String Interpolation

void main() {
  String name = "dart";
  print("플러터는 $name 을 사용합니다");
  int num = 10;
  print("10더하기 10은 ${num+num} 이다");
}

플러터는 dart 을 사용합니다
10더하기 10은 20 이다

이렇게 '$'이 기호를 사용해 텍스트에 변수를 넣을수 있고,
계산을 하기 위해선 ${}안에 계산을 하면 된다