Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
Line : constant String := Ada.Text_IO.Get_Line;
End_Error is raised if EOF is reached.
var line = Console.ReadLine();
Returns `null` if EOF is triggered and no characters are supplied.
Scanner s = new Scanner(System.in);
String line = s.nextLine();
s.close();
The `nextLine` method will throw `NoSuchElementException` when no line is found, and `IllegalStateException` when the scanner is closed.
readln(line);
processing reading the inputs stops when EOF is reached.
$line = <STDIN>;
The < > operator evaluates a filehandle, in this case the built-in filehandle STDIN, which in turn reads a line and returns it. $line contains its trailing newline, if it was present. If EOF is reached, the undefined value (undef) is returned. Perl treats undef as false when tested in a condition.
line = gets
EOF returns nil
let mut buffer = String::new();
let mut stdin = io::stdin();
stdin.read_line(&mut buffer).unwrap();
String is empty if EOF