I have row which is coming from csv file like
"[email protected]","seattle,US","9999 00000"
Expected Output:
[email protected]
seattle,US
9999 00000
Actual output when I do string.Split(',')
:
"[email protected]"
"seattle
US"
"9999 00000"
I have row which is coming from csv file like
"[email protected]","seattle,US","9999 00000"
Expected Output:
[email protected]
seattle,US
9999 00000
Actual output when I do string.Split(',')
:
"[email protected]"
"seattle
US"
"9999 00000"
If you use "
character to qualify a column, you can split by ","
string input = "\"[email protected]\",\"seattle,US\",\"9999 00000\"";
string[] result = input.Trim('"').Split(new string[] { "\",\"" }, StringSplitOptions.None);