CsvField Struct
- Obsolete: Types with embedded references are not supported in this version of your compiler.
The value of a column of a CsvRecord. It is valid until the next record is read.
[Obsolete("Types with embedded references are not supported in this version of your compiler.", true)]
public readonly ref struct CsvFieldProperties
| Name | Description |
|---|---|
| ColumnIndex | Gets the 0-based index of the column. |
| IsEmpty | Gets a value indicating whether the value is empty. |
| IsQuoted | Gets a value indicating whether the value is quoted in the data. |
| RawSpan | Gets the text of the value, as it is in the data. |
| Span | Gets the value, without its quotes, with escaped quotes unescaped and trimmed as CsvReaderOptions.Trim says. |
ColumnIndex
CsvField.csIsEmpty
CsvField.csIsQuoted
CsvField.csRawSpan
CsvField.csGets the text of the value, as it is in the data.
public ReadOnlySpan<char> RawSpan { get; }Property value
Span
CsvField.csGets the value, without its quotes, with escaped quotes unescaped and trimmed as CsvReaderOptions.Trim says.
public ReadOnlySpan<char> Span { get; }Property value
Methods
| Name | Description |
|---|---|
| Parse<T>() | Parses the value with CsvReaderOptions.FormatProvider. |
| ParseEnum<TEnum>(bool) | Parses the value as the name or the number of a member of an enumeration. |
| ToString() | Gets the value as a string. |
| TryParse<T>(T) | Tries to parse the value with CsvReaderOptions.FormatProvider. |
Parse<T>()
CsvField.csParses the value with CsvReaderOptions.FormatProvider.
public T Parse<T>() where T : ISpanParsable<T>Type parameters
T- The type to parse the value to.
Returns
T The parsed value.
Exceptions
CsvException- The value is not valid for
T.
ParseEnum<TEnum>(bool)
CsvField.csParses the value as the name or the number of a member of an enumeration.
Type parameters
TEnum- The type of the enumeration.
Parameters
ignoreCasebooltrueto ignore the case of the name.
Returns
TEnum The parsed value.
Exceptions
CsvException- The value is not valid for
TEnum.
ToString()
CsvField.csTryParse<T>(T)
CsvField.csTries to parse the value with CsvReaderOptions.FormatProvider.
public bool TryParse<T>(out T result) where T : ISpanParsable<T>Type parameters
T- The type to parse the value to.
Parameters
resultT- The parsed value.
Returns
bool true when the value is valid for T; otherwise, false.