るりまサーチ

最速Rubyリファレンスマニュアル検索!
1148件ヒット [1-100件を表示] (0.082秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

String#length -> Integer (18132.0)

文字列の文字数を返します。バイト数を知りたいときは bytesize メソッドを使ってください。

...いときは bytesize メソッドを使ってください。

//emlist[例][ruby]{
"test".length # => 4
"test".size # => 4
"テスト".length # => 3
"テスト".size # => 3
"\x80\u3042".length # => 2
"\x80\u3042".size # => 2
//}

@
see String#bytesize...

CSV::Table#length -> Integer (18126.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...

Integer#bit_length -> Integer (6204.0)

self を表すのに必要なビット数を返します。

...果][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_length # => 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...

Net::HTTPHeader#content_length=(len) (6154.0)

Content-Length: ヘッダフィールドに値を設定します。

...Content-Length: ヘッダフィールドに値を設定します。

len に nil を与えると Content-Length: ヘッダフィールドを
削除します。

@
param len 設定する値を整数で与えます。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/ind...
...ex.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_length = 10 # => 10
req.content_length # => 10
//}...

Net::HTTPHeader#content_length -> Integer|nil (6148.0)

Content-Length: ヘッダフィールドの表している値を整数で返します。

...Content-Length: ヘッダフィールドの表している値を整数で返します。

ヘッダが設定されていない場合には nil を返します。

@
raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。...
...//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_length = 10
req.content_length # => 10
//}...

絞り込み条件を変える

Net::HTTPHeader#range_length -> Integer|nil (6120.0)

Content-Range: ヘッダフィールドの表している長さを整数で返します。

...nil を返します。

@
raise Net::HTTPHeaderSyntaxError Content-Range: ヘッダフィールド
の値が不正である場合に
発生します。


//emlist[例][ruby]{
require 'net/http'

uri...
...= URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['Content-Range'] = "bytes 1-500/1000"
req.range_length # => 500
//}...

String#size -> Integer (3032.0)

文字列の文字数を返します。バイト数を知りたいときは bytesize メソッドを使ってください。

...いときは bytesize メソッドを使ってください。

//emlist[例][ruby]{
"test".length # => 4
"test".size # => 4
"テスト".length # => 3
"テスト".size # => 3
"\x80\u3042".length # => 2
"\x80\u3042".size # => 2
//}

@
see String#bytesize...

CSV::Table#size -> Integer (3026.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...

Array#[]=(start, length, val) (220.0)

インデックス start から length 個の要素を配列 val の内容で置き換えます。 start が自身の末尾を越える時には配列の長さを自動的に拡張し、拡張した領域を nil で初期化します。

...インデックス start から length 個の要素を配列 val の内容で置き換えます。
start が自身の末尾を越える時には配列の長さを自動的に拡張し、拡張した領域を nil で初期化します。

//emlist[例][ruby]{
ary = [0, 1, 2, 3]
ary[1, 2] = ["a", "b"...
...1] = "Z"
p ary #=> [0, 1, 2, nil, nil, "Z"]

ary = [0, 1, 2, 3]
ary[0, 10] = ["a"]
p ary #=> ["a"]
//}

@
param start 置き換えたい範囲の先頭のインデックスを指定します。
start の値が負の時には末尾からの...
...を指定した場合は to_int メソッドによ
る暗黙の型変換を試みます。

@
param length 置き換えたい要素の個数を指定します。
length
の値が 0 のときは start の直前に val を挿入します。
整数以外のオブ...
<< 1 2 3 ... > >>