You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for an awesome piece of code. Very useful.
I am testing for null and empty string values. e.g.
Row 1 - "A",,"C" is returned by CSVReader as the string array [A","","C"]
Row 2 - "A","","C" is also returned as [A","","C"]
There doesn't seem to be any distinction between a null string and an empty string.
I would like row 1 to return as ["A",null,"B"]
Empty string and null can have different meanings in some applications.
Question 1. Is there a way to affect that behavior now ?
Question 2. If not, is it possible to add a constructor parameter or property, with some logic, to change the behavior.
Thanks - Adam
The text was updated successfully, but these errors were encountered:
The CsvReader class actually has some constructors where you can supply a "nullvalue" parameter. This is by default an empty string. So that means that by default all empty strings are handled as null values. If you supply your own string there, e.g. "_null_" then only that string will be handled as a null value, and empty strings will be handled as empty strings.
Hi
First, thanks for an awesome piece of code. Very useful.
I am testing for null and empty string values. e.g.
Row 1 - "A",,"C" is returned by CSVReader as the string array [A","","C"]
Row 2 - "A","","C" is also returned as [A","","C"]
There doesn't seem to be any distinction between a null string and an empty string.
I would like row 1 to return as ["A",null,"B"]
Empty string and null can have different meanings in some applications.
Question 1. Is there a way to affect that behavior now ?
Question 2. If not, is it possible to add a constructor parameter or property, with some logic, to change the behavior.
Thanks - Adam
The text was updated successfully, but these errors were encountered: