るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
10件ヒット [1-10件を表示] (0.028秒)
トップページ > バージョン:2.2.0[x] > クエリ:IO[x] > クラス:Array[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io each_line
  5. io readlines

ライブラリ

検索結果

Array#combination(n) -> Enumerator (18304.0)

サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。

...た配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3, 4]
result = []
a.combination(2) {|e| result << e} # => [1,2,3,4]
result #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
//}

@see Array#permutation, Array#repeated_combination...

Array#combination(n) {|c| block } -> self (18304.0)

サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。

...た配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3, 4]
result = []
a.combination(2) {|e| result << e} # => [1,2,3,4]
result #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
//}

@see Array#permutation, Array#repeated_combination...

Array#permutation(n = self.length) -> Enumerator (18304.0)

サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。

...した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.permutation(2) {|e| result << e} # => [1,2,3]
result # => [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
//}

@see Array#combination, Array#repeated_permutation...

Array#permutation(n = self.length) { |p| block } -> self (18304.0)

サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。

...した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.permutation(2) {|e| result << e} # => [1,2,3]
result # => [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
//}

@see Array#combination, Array#repeated_permutation...

Array#repeated_combination(n) -> Enumerator (18304.0)

サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。

...して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| result << e} # => [1,2,3]
result #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
//}

@see Array#repeated_permutation, Array#combination...

絞り込み条件を変える

Array#repeated_combination(n) { |c| ... } -> self (18304.0)

サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。

...して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| result << e} # => [1,2,3]
result #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
//}

@see Array#repeated_permutation, Array#combination...

Array#repeated_permutation(n) -> Enumerator (18304.0)

サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。

...ロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}

@see Array#repeated_combination, Array#permutation...

Array#repeated_permutation(n) { |p| ... } -> self (18304.0)

サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。

...ロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}

@see Array#repeated_combination, Array#permutation...

Array#to_csv(**options) -> String (304.0)

CSV.generate_line(self, options) と同様です。

...CSV.generate_line(self, options) と同様です。

Array
オブジェクトを 1 行の CSV 文字列に変換するためのショートカットです。

@param options CSV.generate_line と同様のオプションを指定します。

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

p [1, 'Matz', :Ruby, Dat...

Array#pack(template) -> String (40.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...template 自身のバイナリとしてパックするためのテンプレートを文字列で指定します。


以下にあげるものは、Array#pack、String#unpack
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けること...
...endian int32_t
l!<: little endian signed long
//}

=== 各テンプレート文字の説明

説明中、Array#pack と String#unpack で違いのあるものは `/' で区切って
Array#pack の説明 / String#unpack の説明」としています。

: a

ASCII文字列(ヌル文字を詰...

絞り込み条件を変える