Enum in CsvHelper
CsvQuoting
Added in v34.0.0
When CsvWriter encloses fields in quotes.
public enum CsvQuoting- Namespace
CsvHelper- Assembly
CsvHelper.dll- Builds
- net10.0 netstandard2.1 netstandard2.0 net47
- Source
- CsvWriterOptions.cs
Values
| Name | Value | Description |
|---|---|---|
WhenNeeded | 0 | Quote only fields that contain the separator, a quote, CR or LF, as RFC 4180 requires (the default). A record whose only field is empty is written as "" so it is not mistaken for an empty line. |
Always | 1 | Quote every field. Also valid RFC 4180. |
WhenNeededOrWhitespace | 2 | Quote the fields that need it and those that start or end with a space or a tab, so that readers that trim whitespace (outside quotes) keep it, as CsvHelper 33 and earlier did by default. Also valid RFC 4180. |