るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.174秒)
トップページ > クラス:Symbol[x] > クエリ:to_s[x] > バージョン:2.3.0[x] > クエリ:=~[x]

別のキーワード

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

ライブラリ

検索結果

Symbol#=~(other) -> Integer | nil (54394.0)

正規表現 other とのマッチを行います。

正規表現 other とのマッチを行います。

(self.to_s =~ other と同じです。)

@param other 比較対象のシンボルを指定します。

@return マッチが成功すればマッチした位置のインデックスを、そうでなければ nil を返します。

p :foo =~ /foo/ # => 0
p :foobar =~ /bar/ # => 3
p :foo =~ /bar/ # => nil

@see String#=~