I'm working on a program in which user inputs some data, for example:
222, "test", 2 + 2
And I have to split this string by ',' char into an array, so before I was using this method:
string[] parameters = userInput.Split (',');
But, now it came to my mind what if user inputs something like this:
345, "test ,,,,,, ,,,,, ,,,,", 89
Commas are only allowed in the quote characters in my project.
What is the fastest way to split that string into an array, having in mind that problem?
EDIT: It is not parsing CSV file
EDIT 2:
It is expected to return {"345", "\"test ,,,,,, ,,,,, ,,,,\"", "89"} - 3 elements in this array