delete(header_or_index, minimum_index = 0) -> [object, object] | nil
[permalink][rdoc]ヘッダの名前かインデックスで行からフィールドを削除するために使用します。
require "csv"
row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
row.delete("header1")
row # => #<CSV::Row "header2":"row1_2">
require "csv"
row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
row.delete(0)
row # => #<CSV::Row "header2":"row1_2">
require "csv"
row = CSV::Row.new(["header1", "header2", "header1"], ["row1_1", "row1_2", "row1_3"])
row # => #<CSV::Row "header1":"row1_1" "header2":"row1_2" "header1":"row1_3">
row.delete("header1", 1)
row # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
[SEE_ALSO] CSV::Row#field