るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.251秒)
トップページ > クエリ:Shift_JIS[x] > クエリ:String[x] > クラス:StringScanner[x]

別のキーワード

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

ライブラリ

検索結果

StringScanner#matched_size -> Integer | nil (3013.0)

前回マッチした部分文字列の長さを返します。 前回マッチに失敗していたら nil を返します。

...4}" # るびい
s = StringScanner.new(utf8.encode(encode))
s.scan(/#{"\u{308B}".encode(encode)}/)
s.matched_size
end

p run("UTF-8") #=> 3
p run("EUC-JP") #=> 2
p run("Shift_Jis") #=> 2

//}

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

s = StringScanner.new('test string')
s.matched_size # =...