るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. symbol []
  2. symbol slice
  3. win32ole cp_symbol
  4. tracer event_symbol
  5. _builtin symbol

ライブラリ

検索結果

Symbol#=~(other) -> Integer | nil (117376.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#=~