What is $_[0] ,$_[1] in Ruby?

后端 未结 2 631
孤城傲影
孤城傲影 2021-01-12 18:19

I am a Java developer, and I have been given Ruby code to understand and later to work on.

I went through the Ruby tutorials on tutorialspoint.com but I can\'t figur

2条回答
  •  伪装坚强ぢ
    2021-01-12 18:51

    $_ - string last read by gets

    [0] is of course, indexing into that string.

    http://www.rubyist.net/~slagell/ruby/globalvars.html

提交回复
热议问题