るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.037秒)
トップページ > クエリ:array[x] > クエリ:new[x] > クエリ:fields[x]

別のキーワード

  1. array fill
  2. array sample
  3. array []
  4. array new
  5. array fetch

ライブラリ

クラス

キーワード

検索結果

CSV::Row#fields(*headers_and_or_indices) -> Array (18209.0)

与えられた引数に対応する値の配列を返します。

...るこ
とができます。

@return 引数を与えなかった場合は全ての要素を返します。

require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]...

ruby 1.9 feature (3546.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...* [regexp]: 正規表現の機能拡張
* [marshal]: Marshal ファイルのフォーマット変更
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど(互換性のある変更) (only backward-...
...= 2006-09-12

: Hash#compare_by_identity
: Hash#compare_by_identity?

=== 2006-09-11

: Hash#identical
: Hash#identical?

=== 2006-08-31

: Array#shuffle
: Array#shuffle!

追加

=== 2006-07-26

: __send
: __send!

追加

: invoke_method
: invoke_functional_method

削除

=== 2006-07-21

:...
...eneral [lib] [new]
オプション :DoNotReverseLookup 追加。

=== 2004-03-10

: ((<組み込み変数/$-W>)) [ruby] [new]
追加

=== 2004-03-07
: Net::HTTPHeader#add_header [lib] [new]
: Net::HTTPHeader#get_fields [lib] [new]
: Net::HTTPHeader#content_length= [lib] [new]
: Net::HTTPH...

CSV::Row#values_at(*headers_and_or_indices) -> Array (3109.0)

与えられた引数に対応する値の配列を返します。

...るこ
とができます。

@return 引数を与えなかった場合は全ての要素を返します。

require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]...

CSV (24.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...<< ["another", "row"]
# ...
end
//}

=== 一行変換

//emlist[][ruby]{
require 'csv'

csv_string = ["CSV", "data"].to_csv # => "CSV,data"
csv_array = "CSV,String".parse_csv # => ["CSV", "String"]
//}

=== ショートカット

//emlist[][ruby]{
require 'csv'

CSV { |csv_out| cs...
...on)

This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or written to. Your data is never transcoded
(unless you ask Ruby to transcode it for you) and will literally be parsed in
the Encoding it is in. Thus CSV will return Arrays or Rows...
...is not ASCII compatible. There's no existing data for CSV to use to
prepare itself and thus you will probably need to manually specify the desired
Encoding for most of those cases. It will try to guess using the fields in a
row of output though, when using CSV::generate_line() or Array#to_csv()....