Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshClose committed Jan 24, 2024
1 parent 4787314 commit 2aaad88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CsvHelper/Configuration/ConfigurationFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public static bool ShouldQuote(ShouldQuoteArgs args)

var shouldQuote = !string.IsNullOrEmpty(args.Field) &&
(
args.Field.StartsWith(' ') // Starts with a space
|| args.Field.EndsWith(' ') // Ends with a space
args.Field[0] == ' ' // Starts with a space
|| args.Field[^1] == ' ' // Ends with a space
|| args.Field.Contains(config.Quote) // Contains quote
|| !config.IsNewLineSet && args.Field.IndexOfAny(lineEndingChars) > -1 // Contains line ending characters
|| config.IsNewLineSet && args.Field.Contains(config.NewLine) // Contains newline
Expand Down

0 comments on commit 2aaad88

Please sign in to comment.