-
Notifications
You must be signed in to change notification settings - Fork 1
Read
ricardoboss edited this page Sep 13, 2023
·
1 revision
read
reads a single character from StdIn
and returns it as a string.
read()
- the function is blocking until a character is read from
StdIn
- if
StdIn
cannot be read, the function returns an empty string - it does not wait for the user to press "Enter", it returns directly after a single character is read
- the function doesn't mask the users input (so is not safe for passwords)
var c = read()
println("You pressed: " + c)
© 2023 Ricardo Boss • Licensed under MIT • Want to update this page? Edit it on GitHub and submit a pull request!