Exemple #1
0
        public void ParseSimpleStringWithSpaces()
        {
            var parser = new CSVParserBuilder().WithIgnoreLeadingWhiteSpace(false).Build();

            string[] items = parser.ParseLine(new StringReader(" \"a\" , \"b\" , \"c\" "));
            Assert.AreEqual(3, items.Length);
            Assert.AreEqual(" \"a\" ", items[0]);
            Assert.AreEqual(" \"b\" ", items[1]);
            Assert.AreEqual(" \"c\" ", items[2]);
        }
Exemple #2
0
        public void ParseSimpleQuotedStringWithSpacesWithStrictQuotes()
        {
            CSVParser parser = new CSVParserBuilder().WithStrictQuotes(true).Build();

            string[] items = parser.ParseLine(new StringReader(" \"a\" , \"b\" , \"c\" "));
            Assert.AreEqual(3, items.Length);
            Assert.AreEqual("a", items[0]);
            Assert.AreEqual("b", items[1]);
            Assert.AreEqual("c", items[2]);
        }