White space to int? conversion failure #2320
Unanswered
joshjohner
asked this question in
Q&A
Replies: 1 comment
-
You can trim whitespace around your fields. A field that is empty will come through as a null. var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
TrimOptions = TrimOptions.Trim,
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an issue where a column in my csv that maps to a int? contains white space and is causing a type conversion failure.
How can I instruct the CsvHelper to convert whitespace to null?
Beta Was this translation helpful? Give feedback.
All reactions