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