method
to_csv
v2_6_3 -
Show latest stable
- Class:
Array
to_csv(**options)public
Equivalent to CSV::generate_line(self, options)
["CSV", "data"].to_csv #=> "CSV,data\n"
1Note
Prevent new line character.
To prevent the "\
" character added at the end of each file pass in the "row_sep: nil" option:
[ "some", "array" ].to_csv # => "some, array\
"
[ "some", "array" ].to_csv( row_sep: nil ) # => "some, array"