Skip to content

Instantly share code, notes, and snippets.

@montyr75
Last active December 29, 2015 06:19
Show Gist options
  • Save montyr75/7628003 to your computer and use it in GitHub Desktop.
Save montyr75/7628003 to your computer and use it in GitHub Desktop.
Synchronously get a line of user input from the command line console (stdin). Using synchronous I/O in the console can greatly simplify your program.
import "dart:io";
void main() {
// get user input using synchronous I/O
String input = stdin.readLineSync();
// get user input and convert to lowercase
String inputLC = stdin.readLineSync().toLowerCase();
print(input);
print(inputLC);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment