356件ヒット
[1-100件を表示]
(0.096秒)
別のキーワード
ライブラリ
- ビルトイン (260)
-
fiddle
/ import (12) - matrix (24)
- rake (12)
-
rexml
/ document (24) - strscan (24)
クラス
- Array (45)
-
Encoding
:: Converter (24) - Enumerator (12)
- File (12)
-
File
:: Stat (36) - MatchData (24)
- Matrix (24)
- Object (48)
-
REXML
:: Attributes (24) -
Rake
:: Application (12) - Range (24)
- String (35)
- StringScanner (24)
モジュール
-
Fiddle
:: Importer (12)
キーワード
- bind (12)
- blksize (12)
- bsearch (24)
- byterindex (3)
-
each
_ grapheme _ cluster (8) -
each
_ index (12) -
enum
_ for (24) - length (24)
-
matched
_ size (12) - minor (24)
- pack (21)
-
primitive
_ convert (24) - rindex (12)
- size? (12)
- terminate (12)
-
to
_ enum (24) - truncate (12)
- unpack (12)
検索結果
先頭5件
-
Enumerator
# size -> Integer | Float :: INFINITY | nil (27332.0) -
self の要素数を返します。
...合は Float::INFINITY を返します。
Enumerator.new に Proc オブジェクトを指定していた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。
//emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 941......09400
loop.size # => Float::INFINITY
(1..100).drop_while.size # => nil
//}
@see Enumerator.new... -
File
:: Stat # size -> Integer (27220.0) -
ファイルサイズ(バイト単位)を返します。
...ファイルサイズ(バイト単位)を返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.size #=> 1548
//}... -
Range
# size -> Integer | Float :: INFINITY | nil (24338.0) -
範囲内の要素数を返します。
...を返します。始端、終端のいずれかのオブジェクトが
Numeric のサブクラスのオブジェクトではない場合には nil を返します。
//emlist[例][ruby]{
(10..20).size # => 11
("a".."z").size # => nil
(-Float::INFINITY..Float::INFINITY).size # => Infinity
//}......il を返し、始端が succ メソッドを持たない場合は TypeError が発生します。
@raise TypeError self がイテレート可能でない場合に発生します。
//emlist[例][ruby]{
(10..20).size # => 11
("a".."z").size # => nil
(1..).size # => Infinity
(-Float::INFI......NITY..Float::INFINITY).size # => can't iterate from Float (TypeError)
//}... -
MatchData
# size -> Integer (24236.0) -
部分文字列の数を返します(self.to_a.size と同じです)。
...部分文字列の数を返します(self.to_a.size と同じです)。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.size # => 4
//}... -
REXML
:: Attributes # size -> Integer (24214.0) -
属性の個数を返します。
...します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p a.attributes.length # => 3
//}... -
StringScanner
# matched _ size -> Integer | nil (18350.0) -
前回マッチした部分文字列の長さを返します。 前回マッチに失敗していたら nil を返します。
...nil を返します。
マッチしたサイズは文字単位でなくバイト単位となります。
//emlist[][ruby]{
require 'strscan'
def run(encode)
utf8 = "\u{308B 3073 3044}" # るびい
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 # => nil
s.scan(/\w+/) # => "test"
s.matched_size # => 4
s.scan(/\w+/) # => nil
s.matched_size # => nil
//}... -
File
:: Stat # size? -> Integer | nil (15232.0) -
サイズが0の時にはnil、それ以外の場合はファイルサイズを返します。
...にはnil、それ以外の場合はファイルサイズを返します。
//emlist[][ruby]{
require 'tempfile'
fp = Tempfile.new("temp")
p fp.size #=> 0
p File::Stat.new(fp.path).size? #=> nil
fp.print "not 0 "
fp.close
p FileTest.exist?(fp.path) #=> true
p File::Stat.new(fp.path).size? #=> 6
//... -
File
:: Stat # blksize -> Integer (15229.0) -
望ましいI/Oのブロックサイズを返します。
...望ましいI/Oのブロックサイズを返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.blksize #=> nil
//}... -
String
# rindex(pattern , pos = self . size) -> Integer | nil (9438.0) -
文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...文字列のインデックス pos から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現で指......定します。
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)...