るりまサーチ

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

別のキーワード

  1. tracer off
  2. etc sc_v6_ilp32_off32
  3. etc sc_v7_ilp32_off32
  4. etc sc_v6_lp64_off64
  5. etc sc_v7_lp64_off64

ライブラリ

クラス

検索結果

String#byteindex(pattern, offset = 0) -> Integer | nil (18315.0)

文字列の offset から右に向かって pattern を検索し、 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。

...文字列の offset から右に向かって pattern を検索し、
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。

引数 pattern は探索する部分文字列または正規表現で指定...
...am offset 探索を開始するバイト単位のオフセット

@raise IndexError オフセットが文字列の境界以外をさしているときに発生します。

//emlist[例][ruby]{
'foo'.byteindex('f') # => 0
'foo'.byteindex('o') # => 1
'foo'.byteindex('oo') # => 1
'foo'.byteindex('...
...'foo'.byteindex(/f/) # => 0
'foo'.byteindex(/o/) # => 1
'foo'.byteindex(/oo/) # => 1
'foo'.byteindex(/ooo/) # => nil

'foo'.byteindex('o', 1) # => 1
'foo'.byteindex('o', 2) # => 2
'foo'.byteindex('o', 3) # => nil

'foo'.byteindex('o', -1) # => 2
'foo'.byteindex('o', -2) # => 1
'foo'.byteindex('o',...

String#byterindex(pattern, offset = self.bytesize) -> Integer | nil (136.0)

文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。

...文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。

引数 pattern は探索する部...
...分文字列または正規表現で指定します。

off
set が負の場合は、文字列の末尾から数えた位置から探索します。

byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではあり...
...のメソッドも左から右に向かって行います。
以下の例を参照してください。

//emlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしてい...