220件ヒット
[201-220件を表示]
(0.063秒)
別のキーワード
キーワード
- clone (12)
- combination (24)
- concat (21)
- dup (12)
- fetch (12)
- intersection (6)
- none? (21)
- one? (21)
- permutation (24)
-
repeated
_ combination (24) -
repeated
_ permutation (24) -
to
_ csv (12) - union (7)
検索結果
-
Array
# to _ csv(**options) -> String (286.0) -
CSV.generate_line(self, options) と同様です。
...e_line(self, options) と同様です。
Array オブジェクトを 1 行の CSV 文字列に変換するためのショートカットです。
@param options CSV.generate_line と同様のオプションを指定します。
//emlist[][ruby]{
require 'csv'
p [1, 'Matz', :Ruby, Date.new(1965,......4, 14)].to_csv # => "1,Matz,Ruby,1965-04-14\n"
p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv(col_sep: ' ', row_sep: "\r\n") # => "1 Matz Ruby 1965-04-14\r\n"
//}
@see CSV.generate_line... -
Array
# fetch(nth , ifnone) -> object (214.0) -
nth 番目の要素を返します。
...nth 番目の要素を返します。
Array#[] (nth) とは nth 番目の要素が存在しない場合の振舞いが異
なります。最初の形式では、例外 IndexError が発生します。
二番目の形式では、引数 ifnone を返します。
三番目の形式では、ブロッ......@param ifnone 要素が存在しなかった場合に返すべき値を指定します。
@raise TypeError 引数 nth に整数以外の(暗黙の型変換が行えない)オブジェ
クトを指定した場合に発生します。
@raise IndexError 引数 ifnone もブロッ......の要
素も存在しなかった場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end
p a.fetch(10, 999) #=> 999
result = a.fetch(10){|nth|
print "#{nth} はありません...