Splitting string on commas when data can contain commas

前端 未结 3 840
小蘑菇
小蘑菇 2021-01-13 04:51

I have a CSV file (which I didn\'t design and I can\'t change now nor will I ever be able to change it) that contains lines like the following:

\"Surname, Firs

3条回答
  •  终归单人心
    2021-01-13 05:42

    You can handle this easily by using the TextFieldParser class. Just set HasFieldsEnclosedInQuotes to true.

提交回复
热议问题