るりまサーチ (Ruby 2.1.0)

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

別のキーワード

  1. _builtin each_line
  2. io each_line
  3. tracer set_get_line_procs
  4. stringio each_line
  5. pathname each_line

ライブラリ

モジュール

検索結果

Kernel$$NR -> Integer (54661.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$$INPUT_LINE_NUMBER -> Integer (18661.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