Skip to content
instance method

ARGF#readlines

ARGF.readlines(sep = $/, chomp: false) → array
ARGF.readlines(limit, chomp: false) → array
ARGF.readlines(sep, limit, chomp: false) → array

Reads each file in ARGF in its entirety, returning an Array containing lines from the files. Lines are assumed to be separated by sep.

Example
lines = ARGF.readlines
lines[0]                #=> "This is line one\n"

See IO.readlines for a full description of all options.

See also #readline #read_nonblock #readchar #readpartial also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0