680件ヒット
[1-100件を表示]
(0.153秒)
別のキーワード
ライブラリ
- ビルトイン (530)
- csv (36)
-
fiddle
/ import (12) -
net
/ http (24) -
rexml
/ document (36) - strscan (36)
- thread (6)
クラス
- Array (45)
- CSV (12)
-
CSV
:: Table (24) -
Encoding
:: Converter (24) -
File
:: Stat (12) - Integer (12)
- Method (48)
-
Net
:: HTTPGenericRequest (24) - Object (48)
-
REXML
:: Attributes (24) -
REXML
:: Elements (12) - Random (12)
- Range (24)
-
RubyVM
:: InstructionSequence (12) - String (179)
- StringScanner (36)
- Struct (12)
-
Thread
:: SizedQueue (36) - UnboundMethod (72)
モジュール
-
Fiddle
:: Importer (12)
キーワード
- == (24)
- [] (84)
- arity (24)
- bind (12)
-
bit
_ length (12) - blksize (12)
-
body
_ stream (12) -
body
_ stream= (12) - bsearch (48)
- byterindex (3)
- bytes (12)
- bytesize (12)
- clone (12)
- deq (12)
-
each
_ grapheme _ cluster (8) -
enum
_ for (24) - eql? (24)
-
field
_ size _ limit (12) - hash (24)
- length (24)
-
matched
_ size (12) - name (12)
- pack (21)
- peek (12)
- peep (12)
- pop (12)
-
primitive
_ convert (24) - shift (12)
- slice (72)
-
to
_ a (12) -
to
_ enum (24) - unpack (12)
検索結果
先頭5件
-
REXML
:: Elements # size -> Integer (21338.0) -
保持している要素の個数を返します。
...list[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a>sean<b/>elliott<b/>russell<b/></a>'
# doc.root は3つの要素と3つのテキストノードを持つため、6を返す
doc.root.size # => 6
# そのうち要素は3つであるため、以下は3を返す
doc.root.el......ements.size # => 3
//}... -
CSV
:: Table # size -> Integer (21332.0) -
(ヘッダを除く)行数を返します。
...(ヘッダを除く)行数を返します。
Array#length, Array#size に委譲しています。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.size # => 1
//}
@see Array#length, Array#size... -
REXML
:: Attributes # size -> Integer (21308.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
//}... -
String
# bytesize -> Integer (18525.0) -
文字列のバイト長を整数で返します。
...文字列のバイト長を整数で返します。
//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}
@see String#size... -
File
:: Stat # blksize -> Integer (15407.0) -
望ましいI/Oのブロックサイズを返します。
...望ましいI/Oのブロックサイズを返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.blksize #=> nil
//}... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (12867.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... -
Random
# bytes(size) -> String (12414.0) -
ランダムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。
...ランダムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。
@param size 結果の文字列のサイズをバイト数で指定します。
//emlist[例][ruby]{
r2 = Random.new(1)
p r2.bytes(10) # => "%\xF4\xC1j\xEB\x80G\xFF\x8C/"
//}......ムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。
@param size 結果の文字列のサイズをバイト数で指定します。
//emlist[例][ruby]{
r2 = Random.new(1)
p r2.bytes(10) # => "%\xF4\xC1j\xEB\x80G\xFF\x8C/"
//}
@see Random.bytes... -
Integer
# bit _ length -> Integer (12367.0) -
self を表すのに必要なビット数を返します。
...
-1 である)場合は 0 を返します。
//emlist[例: ceil(log2(int < 0 ? -int : int+1)) と同じ結果][ruby]{
(-2**12-1).bit_length # => 13
(-2**12).bit_length # => 12
(-2**12+1).bit_length # => 12
-0x101.bit_length # => 9
-0x100.bit_length # => 8
-0xff.bit_len......gth # => 8
-2.bit_length # => 1
-1.bit_length # => 0
0.bit_length # => 0
1.bit_length # => 1
0xff.bit_length # => 8
0x100.bit_length # => 9
(2**12-1).bit_length # => 12
(2**12).bit_length # => 13
(2**12+1).bit_......length # => 13
//}
@see Integer#size... -
StringScanner
# matched _ size -> Integer | nil (12362.0) -
前回マッチした部分文字列の長さを返します。 前回マッチに失敗していたら nil を返します。
...list[][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
//}... -
CSV
# field _ size _ limit -> Integer (12344.0) -
フィールドサイズの最大値を返します。
...ist[例][ruby]{
require "csv"
csv = CSV.new(DATA)
csv.field_size_limit # => nil
p csv.read # => [["a", "b"], ["\n2\n2\n", ""]]
DATA.rewind
csv = CSV.new(DATA, field_size_limit: 4)
p csv.field_size_limit # => 4
csv.read # => #<CSV::MalformedCSVError: Field size exceeded on line 2.>
__END__
"a","b"...