Replies: 2 comments
-
Perhaps an approach would be to use Here is the rejected API suggestion to implement |
Beta Was this translation helpful? Give feedback.
-
I'm aware that it was rejected, but I don't own the library to write csvs (
As I maintain this internal library, I'm wondering if I should be embedding this logic to fallback to just write it for strings in my library code (it will probably get eliminated for the valueType case which is the 99% case). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a generalization that I'm using for several different geospatial database formats (gdb, shpfile, etc) that represents a field on a row.
I use abit of indirection magic with a
Token<T>
type to encode the C# type and that allows me to write a fairly simpleISpanFormattable
for valueTypes which is pretty much most of what I'll encounter, but there are also Strings that I need to worry about. I'm using this primarily forSep
, so that I can read data stored in this terrible format and just basically goSep.Format(row[i])
. Whererow[i]
returns one of my DbFields. Unfortunately, this doesn't work with strings, as strings are notISpanFormattable
. Should I explictly test if the field is a string? What is the best way to handle this?Here is a rough idea of what I'm doing:
https://gist.github.com/mburbea/e8c67264899da5a35c0c9ab5ba54d6fc
Beta Was this translation helpful? Give feedback.
All reactions