티스토리 뷰
In Flutter, triple single-quotation marks (`'''`) are used to create multi-line string literals, also known as multi-line string constants. This syntax allows you to define a string that spans multiple lines while preserving the line breaks and formatting within the string. This is particularly useful for long strings or strings that contain line breaks, such as text blocks or code snippets.
Here's an example of how to use triple single-quotation marks to create a multi-line string in Flutter:
// >>>Code
String multiLineString = '''
This is a multi-line string
in Flutter using triple single-quotation marks.
It allows you to include line breaks and maintain formatting.
You can also use it for code blocks or long text.
''';
// <<<Code
In the above example, the `multiLineString` variable contains a multi-line string that spans three lines, and the line breaks and formatting within the string are preserved.
You can use triple single-quotation marks for various purposes, such as defining textual content for your Flutter widgets or embedding code snippets within your Dart code. They provide a convenient way to create well-formatted, multi-line strings in your Flutter applications.
'DevMobile > Flutter' 카테고리의 다른 글
Widget Tree (Flutter App Structure) (0) | 2023.08.27 |
---|
- Total
- Today
- Yesterday
- Level A2
- IT Nomad
- 해외생활
- b2 level
- ChatGPT
- 가정법
- 호주생활
- NOMAD
- b1 level
- IT
- level b1
- study english
- travel
- 영어
- Australia
- Mobile
- vocabulary
- 조건문
- 호주로또
- News
- study
- level c1
- Intermediate
- Upper-Intermediate
- conditionals
- Aussie
- Grammar
- English
- Level B2
- IT Namad
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |