Ruby 2.6.0 リファレンスマニュアル > ライブラリ一覧 > Englishライブラリ > Kernelモジュール > $INPUT_RECORD_SEPARATOR

variable $INPUT_RECORD_SEPARATOR

$RS -> String | nil[permalink][rdoc] [added by English]
$INPUT_RECORD_SEPARATOR -> String | nil [added by English]

$/ の別名

require "English"

$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
  array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]

__END__
ugo|ego|fogo