We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 92987ff + 3b12036 commit 7c12cb4Copy full SHA for 7c12cb4
src/WebApiContrib.Core.Formatter.Csv/CsvOutputFormatter.cs
@@ -97,8 +97,11 @@ await streamWriter.WriteLineAsync(
97
98
var _val = val.Value.ToString();
99
100
- //Check if the value contans a comma and place it in quotes if so
101
- if (_val.Contains(","))
+ //Escape quotas
+ _val = _val.Replace("\"", "\"\"");
102
+
103
+ //Check if the value contans a delimiter and place it in quotes if so
104
+ if (_val.Contains(_options.CsvDelimiter))
105
_val = string.Concat("\"", _val, "\"");
106
107
//Replace any \r or \n special characters from a new line with a space
0 commit comments