private CsvTextFieldParser CreateActualParser(string input, bool trimWhiteSpace, bool hasFieldsEnclosedInQuotes) { var parser = new CsvTextFieldParser(new StringReader(input)); parser.CompatibilityMode = true; parser.TrimWhiteSpace = trimWhiteSpace; parser.HasFieldsEnclosedInQuotes = hasFieldsEnclosedInQuotes; return(parser); }
public IEnumerable <string[]> ParseFancyCsv(string input) { using (var parser = new CsvTextFieldParser(new StringReader(input)) { HasFieldsEnclosedInQuotes = false }) { while (!parser.EndOfData) { yield return(parser.ReadFields()); } } }