ARGF.getc â String or nil
Instance Public methods
Reads the next character from ARGF
and returns it as a
String
. Returns nil
at the end of the stream.
ARGF
treats the files named on the command line as a single
file created by concatenating their contents. After returning the last
character of the first file, it returns the first character of the second
file, and so on.
For example:
1 2 3 4 5 6 7 8 9 | $ echo "foo" > file $ ruby argf.rb file ARGF .getc #=> "f" ARGF .getc #=> "o" ARGF .getc #=> "o" ARGF .getc #=> "\n" ARGF .getc #=> nil ARGF .getc #=> nil |
Please login to continue.