summaryrefslogtreecommitdiff
path: root/doc/csv/strip.rdoc
blob: 56ae4310c35fa34911edd38ab4d2b943f20362f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
====== Option +strip+

Specifies the boolean value that determines whether
whitespace is stripped from each input field.

Default value:
  CSV::DEFAULT_OPTIONS.fetch(:strip) # => false

With default value +false+:
  ary = CSV.parse_line(' a , b ')
  ary # => [" a ", " b "]

With value +true+:
  ary = CSV.parse_line(' a , b ', strip: true)
  ary # => ["a", "b"]