11

If possible, how can I change the delimiter from comma to semicolon when using ServiceStack.Text.CsvSerializer?

devghost
  • 560
  • 7
  • 13

1 Answers1

22

You can control this by setting

 ServiceStack.Text.CsvConfig.ItemSeperatorString = ";";

From the version 3.9.14 Release Notes:

  • CsvConfig.ItemSeperatorString - Enables configuration of the separator between items in a csv file (ie | or ; rather than ,)
  • CsvConfig.ItemDelimiterString - Enables configuration of the delimiter for an item that needs to be escaped in a csv file (ie | rather than ")
  • CsvConfig.RowSeparatorString - Enables configuration of the delimiter for a row of items in a csv file (ie | \r\n)

Note that the setting is thread static. (Note also the misspelling.)

dbc
  • 104,963
  • 20
  • 228
  • 340