るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.302秒)
トップページ > モジュール:Kernel[x] > クエリ:kernel[x] > バージョン:2.6.0[x] > クエリ:$INPUT_LINE_NUMBER[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Kernel$$INPUT_LINE_NUMBER -> Integer (81325.0)

$. の別名

$. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5

Kernel$$NR -> Integer (36025.0)

$. の別名

$. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5