557件ヒット
[1-100件を表示]
(0.140秒)
別のキーワード
ライブラリ
- ビルトイン (353)
- fiddle (24)
- matrix (96)
- pathname (24)
-
rubygems
/ package / tar _ writer (24) - strscan (24)
-
webrick
/ server (12)
クラス
- Array (36)
- Enumerator (12)
-
Fiddle
:: Pointer (24) -
Gem
:: Package :: TarWriter (24) - Integer (12)
- MatchData (24)
- Matrix (48)
- Object (48)
- Pathname (24)
-
RubyVM
:: InstructionSequence (12) - String (175)
- StringScanner (24)
- Symbol (24)
-
Thread
:: SizedQueue (10) - Vector (48)
-
WEBrick
:: GenericServer (12)
キーワード
- + (24)
- - (24)
- [] (72)
-
add
_ file _ simple (24) -
bit
_ length (12) - bsearch (24)
- byterindex (3)
- clear (12)
- close (10)
- each2 (24)
-
each
_ grapheme _ cluster (16) -
each
_ index (12) -
enum
_ for (24) - length (24)
- minor (24)
- rindex (12)
- size? (12)
- slice (72)
- terminate (12)
-
to
_ a (12) -
to
_ enum (24) -
to
_ str (24) - tokens (12)
検索結果
先頭5件
-
Pathname
# size -> Integer (21240.0) -
FileTest.size(self.to_s) と同じです。
...FileTest.size(self.to_s) と同じです。
@see FileTest.#size... -
Enumerator
# size -> Integer | Float :: INFINITY | nil (21236.0) -
self の要素数を返します。
...
self の要素数を返します。
要素数が無限の場合は Float::INFINITY を返します。
Enumerator.new に Proc オブジェクトを指定していた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。
/....../emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 94109400
loop.size # => Float::INFINITY
(1..100).drop_while.size # => nil
//}
@see Enumerator.new... -
MatchData
# size -> Integer (18240.0) -
部分文字列の数を返します(self.to_a.size と同じです)。
...部分文字列の数を返します(self.to_a.size と同じです)。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.size # => 4
//}... -
Symbol
# size -> Integer (18214.0) -
シンボルに対応する文字列の長さを返します。
...シンボルに対応する文字列の長さを返します。
(self.to_s.length と同じです。)
:foo.length #=> 3
@see String#length, String#size... -
StringScanner
# terminate -> self (9321.0) -
スキャンポインタを文字列末尾後まで進め、マッチ記録を捨てます。
...ます。
@return self を返します。
pos = self.string.size と同じ動作です。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.scan(/\w+/) # => "test"
s.matched # => "test"
s.pos # => 4
s[0] # => "test"
s.terminate
s.matched # =>......nil
s[0] # => nil
s.pos # => 11
//}
StringScanner#clear は将来のバージョンで削除される予定です。
代わりに StringScanner#terminate を使ってください。... -
Pathname
# size? -> bool (9140.0) -
FileTest.size?(self.to_s) と同じです。
...FileTest.size?(self.to_s) と同じです。
@see FileTest.#size?... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (6602.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...イト単位のインデックス offset から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列ま......たは正規表現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探......//emlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex... -
String
# each _ grapheme _ cluster {|grapheme _ cluster| block } -> self (6314.0) -
文字列の書記素クラスタに対して繰り返します。
...。
String#each_char と違って、
Unicode Standard Annex #29 (https://unicode.org/reports/tr29/)
で定義された書記素クラスタに対して繰り返します。
//emlist[例][ruby]{
"a\u0300".each_char.to_a.size # => 2
"a\u0300".each_grapheme_cluster.to_a.size # => 1
//}
@see String#g......rapheme_clusters... -
Object
# to _ enum(method = :each , *args) -> Enumerator (6253.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場......Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (6253.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場......Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz...