If possible, how can I change the delimiter from comma to semicolon when using ServiceStack.Text.CsvSerializer?
Change CSV delimiter in ServiceStack.Text.CsvSerializer
Asked Answered
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.)
© 2022 - 2024 — McMap. All rights reserved.