FieldCount
public int FieldCount { get; }The number of fields in the record.
Ref struct in CsvHelper
A view of the current record of a CsvReader. Valid until the next read.
public readonly ref struct CsvRowCsvHelperCsvHelper.dllpublic int FieldCount { get; }The number of fields in the record.
public ReadOnlySpan<byte> RawRecord { get; }The raw bytes of the record (UTF-8), without the line break.
public long RowNumber { get; }The 1-based number of the data record.
public CsvField this[int index] { get; }Gets field index. See CsvReader.GetSpan(int).
indexintindex is negative.index is not less than FieldCount and CsvReaderOptions.MissingField is CsvMissingFieldHandling.Throw.public CsvField this[string name] { get; }Gets the field with the given header name.
namestringname is null.public ReadOnlySpan<byte> GetSpan(int index)Gets the value of field index as UTF-8 bytes. See CsvReader.GetSpan(int).
indexintindex is negative.index is not less than FieldCount and CsvReaderOptions.MissingField is CsvMissingFieldHandling.Throw.public string GetString(int index)Gets field index as a string. See CsvReader.GetString(int).
indexintindex is negative.index is not less than FieldCount and CsvReaderOptions.MissingField is CsvMissingFieldHandling.Throw.net10.0
public T Parse<T>(int index) where T : ISpanParsable<T>Parses field index as T. See CsvReader.Parse<T>(int).
TindexintT.T.T is not one of the built-in types.index is negative.index is not less than FieldCount and CsvReaderOptions.MissingField is CsvMissingFieldHandling.Throw.netstandard2.1, netstandard2.0, net47
public T Parse<T>(int index)Parses field index as T. See CsvReader.Parse<T>(int).
TindexintT.T.T is not one of the built-in types.index is negative.index is not less than FieldCount and CsvReaderOptions.MissingField is CsvMissingFieldHandling.Throw.public T Parse<T>(int index, Func<string, IFormatProvider, T> parser)Parses field index with parser (see CsvReader.Parse<T>(int, Func<string, IFormatProvider, T>)).
Tparser returns.indexintparserFunc<string, IFormatProvider, T>parser returns.parser is null.index is negative.index is not less than FieldCount and CsvReaderOptions.MissingField is CsvMissingFieldHandling.Throw.public string[] ToArray()Copies all fields of the record into a new string array.
public Dictionary<string, string?> ToDictionary()Copies the record into a new dictionary keyed by column name: the header names (each once, with its first column), or Field1, Field2 and so on without a header. A value is null when it is one of CsvReaderOptions.NullValues, as for CsvReader.GetStringOrNull(int).
public override string ToString()Gets the record as it appears in the input, without the line break.