Ruby/String/lines
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
In Ruby ytes, lines, and chars are aliases
s = "A\nB" # Three ASCII characters on two lines puts s.bytes.to_a # => [65,10,66]: alias for each_byte puts s.lines.to_a # => ["A\n","B"]: alias for each_line puts s.chars.to_a # => ["A", "\n", "B"] alias for each_char