Skip to content

Commit

Permalink
Add: multi-line string to the example
Browse files Browse the repository at this point in the history
  • Loading branch information
rosera committed Jan 14, 2022
1 parent bb3d91b commit 5aefd13
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
17 changes: 15 additions & 2 deletions dart/lab01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,25 @@ Dart uses strings to represent multiple characters

* If you need to store a name i.e 'Seth Ladd'
* If you need to store an address i.e. '1600 Amphitheatre Parkway, Mountain View, CA 94043, USA'
* If you need to store a multiline i.e. 'Super long text ... still super long text ... still going'

#### [Example](https://github.com/rosera/flutter_workshop/blob/main/dart/lab01/solutions/hello-string.dart):

```dart
String myFirstName = 'Seth';
String myFavouritePhrase = 'This elixir mister got a maze in vista';
String myFirstName = 'Seth';
String myFavouritePhrase = 'This elixir mister got a maze in vista';
String myOtherName = "Doug";
String multiLine = '''
Hello
This is a multi-line
Text which is over multiple line
''';
print(myFirstName);
print(myFavouritePhrase);
print(myOtherName);
print(multiLine);
```


Expand Down
16 changes: 14 additions & 2 deletions dart/lab01/solutions/hello-string.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
void main(){
String getCourseName = "flutter bootcamp 21";
print ('Hello $getCourseName');
String myFirstName = 'Seth';
String myFavouritePhrase = 'This elixir mister got a maze in vista';
String myOtherName = "Doug";

String multiLine = '''
Hello
This is a multi-line
Text which is over multiple line
''';

print(myFirstName);
print(myFavouritePhrase);
print(myOtherName);
print(multiLine);
}

0 comments on commit 5aefd13

Please sign in to comment.