Skip to content

ShouldQuote depending on field value? #2259

Answered by JoshClose
rorourke-iot asked this question in Q&A
Discussion options

You must be logged in to vote
var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
	ShouldQuote = args =>
	{
		if (args.Field.Length == 0)
		{
			return true;
		}
		
		return ConfigurationFunctions.ShouldQuote(args);
	}
};

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@rorourke-iot
Comment options

@JoshClose
Comment options

@JoshClose
Comment options

Answer selected by rorourke-iot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants