I use the .Split(',') method for a string that, as I know, has comma-separated values, and I want these values ββto be separated and placed in a string[] object. This works fine for lines like this:
78,969.82,GW440,
But the values ββbegin to look different if this second value exceeds 1000, for example, found in this example:
79,"1,013.42",GW450,...
These values ββcome from a spreadsheet control, where I use the controls built into the ExportToCsv(...) method, and this explains why the formatted version of the actual numerical value.
Question
Is there a way to force the .Split(',') method to ignore commas inside quotes? I really do not want the value "1,013.42" divided as "1 and 013.42" .
Any ideas? Thanks!
Update
I really would like to do this without the inclusion of a third-party tool, since my precedent does not really include many other things, besides this, and even if it is part of my working solution, having such a tool, At the moment it is really profitable. I was hoping there was something quick to solve this particular use case that I was missing, but now that itβs the weekend, Iβll see if I can give another update of this question on Monday with the solution Iβm in eventually come with. Thank you all for your help, I will evaluate each answer further on Monday.
string split c #
Jake smith
source share