readlines(p1, p2 = v2, p3 = v3, p4 = v4) public

Reads the entire file specified by name as individual lines, and returns those lines in an array. Lines are separated by sep.

a = IO.readlines("testfile")
a[0]   #=> "This is line one\n"

If the last argument is a hash, it’s the keyword argument to open. See for detail.

Show source
Register or log in to add new notes.