each_line and each_byte
s = "A\nB" # Three ASCII characters on two lines s.each_byte {|b| print b, " " } # Prints "65 10 66 " s.each_line {|l| print l.chomp} # Prints "AB"