From 50dc2918bb71182ab03f7345abb121a50efe4739 Mon Sep 17 00:00:00 2001 From: David Stalder <43542299+dastal@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:05:33 +0100 Subject: [PATCH] Update GettingUserInput.md --- Dart_Course/docs/GettingUserInput.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dart_Course/docs/GettingUserInput.md b/Dart_Course/docs/GettingUserInput.md index 0de6eeb..4bcae82 100644 --- a/Dart_Course/docs/GettingUserInput.md +++ b/Dart_Course/docs/GettingUserInput.md @@ -2,17 +2,18 @@ First we need to import a low level input-output library to get the basic I/O functions of Dart: -´´´javascript +```javascript import 'dart:io'; -´´´ +``` Following code snippet to explain the input functionaltiy of Dart: -´´´javascript +```javascript print("What is your name?"); String? username = stdin.readLineSync(); print("Hello ${username}!"); -´´´ +``` -´stdin´ is the standard input stream of dart. -´readLineSync()´ reads the line from the standard input. \ No newline at end of file +`stdin` is the standard input stream of dart. + +`readLineSync()` reads the line from the standard input.