There is a method in the Java scanner next()that reads the next token from the stream, where the token is something separated by delimiters (by default, the delimiter is any space character, including a tab and a new line).
next()
How can I do this using C # /. NET? A thread in C # has Read()and ReadLine(), but they don't have a space or user separator concept. I can read the whole line and then use the string method Split(), but that means I have to read the whole line first (unlike next(), which only reads the next token).
Read()
ReadLine()
Split()
, , . , StreamReader , (.. , ). StringBuilder " " , , .
StreamReader
StringBuilder
, , , , , . , StringBuilder , , .
, Scanner - . , IEnumerable<string> . , Func<TextReader>, TextReader, .
Scanner
IEnumerable<string>
Func<TextReader>
TextReader