How to write a value which contain comma to a CSV file in c#?

前端 未结 6 1492
时光取名叫无心
时光取名叫无心 2021-01-01 14:58

I am using a data table for storing data.

I am exporting the data from data table to CSV file.

Sometimes there may be values containing comma(,)

6条回答
  •  庸人自扰
    2021-01-01 15:26

    If you have a comma in the data you need to put in a csv the http://tools.ietf.org/html/rfc4180 says to use quotations as:

    "123,56","A dog, cat and a frog"
    

提交回复
热议问题