ライブラリ
- ビルトイン (74)
- csv (33)
- dbm (11)
- gdbm (11)
-
net
/ http (242) -
rubygems
/ indexer (33) -
rubygems
/ source _ index (33) - sdbm (11)
- strscan (22)
-
yaml
/ dbm (11)
クラス
-
CSV
:: Table (33) - DBM (11)
- GDBM (11)
-
Gem
:: Indexer (33) -
Gem
:: SourceIndex (33) - MatchData (11)
-
Net
:: HTTPGenericRequest (33) -
Net
:: HTTPResponse (88) - Regexp (11)
- SDBM (11)
- String (52)
- StringScanner (22)
-
YAML
:: DBM (11)
モジュール
-
Net
:: HTTPHeader (121)
キーワード
- [] (44)
-
basic
_ auth (11) - body (22)
- byteindex (2)
- byterindex (2)
- bytesplice (4)
- code (11)
- delete (11)
-
dest
_ directory (11) - directory (11)
- entity (11)
- fetch (33)
-
gem
_ signature (11) -
get
_ fields (11) - getbyte (11)
-
http
_ version (11) -
index
_ signature (11) -
main
_ type (11) - method (22)
- msg (11)
-
named
_ captures (11) - path (11)
- pointer= (11)
- pos= (11)
-
proxy
_ basic _ auth (11) -
read
_ body (22) - rindex (11)
-
sanitize
_ string (11) - setbyte (11)
-
spec
_ dirs (11) -
sub
_ type (11) -
values
_ at (11)
検索結果
先頭5件
-
String
# index(pattern , pos = 0) -> Integer | nil (39144.0) -
文字列のインデックス pos から右に向かって pattern を検索し、 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...ンデックス
//emlist[例][ruby]{
p "astrochemistry".index("str") # => 1
p "regexpindex".index(/e.*x/, 2) # => 3
p "character".index(?c) # => 0
p "foobarfoobar".index("bar", 6) # => 9
p "foobarfoobar".index("bar", -6) # => 9
//}
@see String#rindex......mlist[例][ruby]{
p "astrochemistry".index("str") # => 1
p "regexpindex".index(/e.*x/, 2) # => 3
p "character".index(?c) # => 0
p "foobarfoobar".index("bar", 6) # => 9
p "foobarfoobar".index("bar", -6) # => 9
//}
@see String#rindex
@see String#byteindex... -
String
# rindex(pattern , pos = self . size) -> Integer | nil (27149.0) -
文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...列または正規表現で指定します。
pos が負の場合は、文字列の末尾から数えた位置から探索します。
rindex と String#index とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索......//emlist[String#index の場合][ruby]{
p "stringstring".index("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#rindex の場合][ruby]{
p "stringstring".rindex("ing", -1) #......ンデックス
//emlist[例][ruby]{
p "astrochemistry".rindex("str") # => 10
p "character".rindex(?c) # => 5
p "regexprindex".rindex(/e.*x/, 2) # => 1
p "foobarfoobar".rindex("bar", 6) # => 3
p "foobarfoobar".rindex("bar", -6) # => 3
//}
@see String#index... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (27131.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...は正規表現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索......list[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("ing......'foo'.byterindex('f') # => 0
'foo'.byterindex('o') # => 2
'foo'.byterindex('oo') # => 1
'foo'.byterindex('ooo') # => nil
'foo'.byterindex(/f/) # => 0
'foo'.byterindex(/o/) # => 2
'foo'.byterindex(/oo/) # => 1
'foo'.byterindex(/ooo/) # => nil
# 右でのマッチが優先
'foo'.byterindex(/o+/) # =... -
String
# byteindex(pattern , offset = 0) -> Integer | nil (27119.0) -
文字列の offset から右に向かって pattern を検索し、 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...@raise IndexError オフセットが文字列の境界以外をさしているときに発生します。
//emlist[例][ruby]{
'foo'.byteindex('f') # => 0
'foo'.byteindex('o') # => 1
'foo'.byteindex('oo') # => 1
'foo'.byteindex('ooo') # => nil
'foo'.byteindex(/f/) # => 0
'foo'.byteindex(/o/) # =......index(/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', -3) # => 1
'foo'.byteindex('o', -4) # => nil
'あいう'.byteindex......('う') # => 6
'あいう'.byteindex('う', 3) # => 6
'あいう'.byteindex('う', -3) # => 6
'あいう'.byteindex('う', 1) # offset 1 does not land on character boundary (IndexError)
//}
@see String#index, String#byterindex... -
String
# bytesplice(index , length , str) -> String (21228.0) -
self の一部または全部を str で置き換えて str を返します。
...囲の指定は、長さの指定が省略できないこと以外は
String#byteslice と同じです。
置き換え後の文字列の長さが対象の長さと違う場合、
適切に長さが調整されます。
@param index 置換したい文字列の範囲の始端
@param length 置換し......い文字列の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# getbyte(index) -> Integer | nil (21130.0) -
index バイト目のバイトを整数で返します。
...
index バイト目のバイトを整数で返します。
index に負を指定すると末尾から数えた位置のバイト
を取り出します。
範囲外を指定した場合は nil を返します。
@param index バイトを取り出す位置
//emlist[例][ruby]{
s = "tester"
s.bytes... -
String
# setbyte(index , b) -> Integer (21130.0) -
index バイト目のバイトを b に変更します。
...
index バイト目のバイトを b に変更します。
index に負を指定すると末尾から数えた位置を変更します。
セットした値を返します。
@param index バイトをセットする位置
@param b セットするバイト(0 から 255 までの整数)
@raise Inde... -
String
# bytesplice(range , str) -> String (21128.0) -
self の一部または全部を str で置き換えて str を返します。
...囲の指定は、長さの指定が省略できないこと以外は
String#byteslice と同じです。
置き換え後の文字列の長さが対象の長さと違う場合、
適切に長さが調整されます。
@param index 置換したい文字列の範囲の始端
@param length 置換し......い文字列の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
DBM
# index(value) -> String | nil (18203.0) -
このメソッドは deprecated です。DBM#key を使用してください。
このメソッドは deprecated です。DBM#key を使用してください。 -
GDBM
# index(val) -> String (18203.0) -
このメソッドは deprecated です。GDBM#key を使用してください。
このメソッドは deprecated です。GDBM#key を使用してください。 -
SDBM
# index(val) -> String | nil (18203.0) -
このメソッドは deprecated です。SDBM#key を使用してください。
このメソッドは deprecated です。SDBM#key を使用してください。 -
YAML
:: DBM # index(value) -> String | nil (18203.0) -
value を持つ要素のキーを返します。
value を持つ要素のキーを返します。
対応するキーが見つからなかった場合は nil を返します。
@param value 検索したい値を指定します。YAML 形式に変換できるオブジェク
トが指定できます。
[注意] 非推奨のメソッドです。代わりに #key を使用してください。
@see YAML::DBM#key -
Gem
:: Indexer # sanitize _ string(string) -> String (9310.0) -
与えられた文字列をサニタイズします。
...与えられた文字列をサニタイズします。
@param string サニタイズ対象の文字列を指定します。
@see Gem::Indexer#sanitize...