我正在将以下代码用于puts
屏幕的列:
CSV.foreach(
response_file,
:col_sep => "\t",
:encoding => 'BOM|UTF-16LE:UTF-8',
:quote_char => '"',
:headers => true
) do |column|
puts column[/\sPlease help us improve by telling us why you chose that ranking.\s/]
end
实际的标题名称Please help us improve by telling us why you chose that ranking.
在开头有一个空格和一个制表符,最后是一个额外的空格。
但是,这没有找到正确的列。我究竟做错了什么?