るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.047秒)
トップページ > ライブラリ:ビルトイン[x] > バージョン:2.6.0[x] > クエリ:inspect[x] > クエリ:_builtin[x] > クラス:MatchData[x]

別のキーワード

  1. _builtin inspect
  2. csv inspect
  3. matrix inspect
  4. set inspect

検索結果

MatchData#inspect -> String (78385.0)

self の内容を人間に読みやすい文字列にして返します。

...ch("foo").inspect
# => #<MatchData "o">

puts /(.)(.)(.)/.match("foo").inspect
# => #<MatchData "foo" 1:"f" 2:"o" 3:"o">

puts /(.)(.)?(.)/.match("fo").inspect
# => #<MatchData "fo" 1:"f" 2:nil 3:"o">

puts /(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").inspect
# => #<MatchData "hog" foo:"h" bar:"o" ba...