るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.137秒)

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n=
  3. rsa n
  4. pop n_bytes
  5. openssl n=

ライブラリ

クラス

検索結果

StringScanner#matched? -> bool (63379.0)

前回のマッチが成功していたら true を、 失敗していたら false を返します。

前回のマッチが成功していたら true を、
失敗していたら false を返します。

//emlist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
s.matched? # => false
s.scan(/\w+/) # => "test"
s.matched? # => true
s.scan(/\w+/) # => nil
s.matched? # => false
s.scan(/\s+/) # => " "
s.matched? # => true
//}