るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. t61string new
  4. matrix t
  5. fiddle type_size_t

検索結果

CSV#col_sep -> String (217.0)

カラム区切り文字列として使用する文字列を返します。

...//emlist[例][ruby]{
require "csv"

users =<<-EOS
id|first name|last name|age
1|taro|tanaka|20
2|jiro|suzuki|18
3|ami|sato|19
4|yumi|adachi|21
EOS

csv
= CSV.new(users, headers: true, col_sep: "|")
csv
.col_sep # => "|"
csv
.first.to_a # => [["id", "1"], ["first name", "taro"], ["last name", "tanaka"]...
..., ["age", "20"]]

csv
= CSV.new(users, headers: true)
csv
.col_sep # => ","
csv
.first.to_a # => [["id|first name|last name|age", "1|taro|tanaka|20"]]
//}

@see CSV.new...