るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

クラス

検索結果

CSV#col_sep -> String (421.0)

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

..."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...