Constructs the CSV reader for the provided text reader
Syntax
Visual Basic (Declaration) | |
---|
Public Function New( _
ByVal reader As TextReader _
) |
Parameters
- reader
- The text reader to read from
Example
Library/Library.Test/TestCsvReader.cs
C# | Copy Code |
---|
using (CsvReader r = new CsvReader(new StringReader(CSV_DOC1)))
{
r.Read();
Assert.AreEqual("1a", r["f1"]);
Assert.AreEqual("1b", r[1]);
Assert.AreEqual("1c", r.GetString(2));
Assert.AreEqual("1c", r.GetValues()[2]);
} |
VB.NET | Copy Code |
---|
Using r As New CsvReader(New StringReader(CSV_DOC1))
r.Read()
Assert.AreEqual("1a", r("f1"))
Assert.AreEqual("1b", r(1))
Assert.AreEqual("1c", r.GetString(2))
Assert.AreEqual("1c", r.GetValues()(2))
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also