KEMBAR78
Dart User Input with readLineSync | PDF
0% found this document useful (0 votes)
16 views1 page

Dart User Input with readLineSync

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

Dart User Input with readLineSync

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

User Input in dart

In Dart programming language, you can take


standard input from the user through the
console via the use of .readLineSync() function.
To take input from the console you need to
import a library, named dart:io from libraries of
Dart.
Function: stdin.readLineSync()
Example:
void main() {
int n = int.parse(stdin.readLineSync()!); // stdin.readLineSync()
used for int value
String? name = stdin.readLineSync()!; // stdin.readLineSync() used
for String value
print("enter name: ${name}");
print("enter number: ${n}");
}

You might also like