TableHelper Class

Helper methods for parsing tables.

public static class TableHelper

Methods

NameDescription
ParseColumnHeader(StringSlice, char, TableColumnAlign?, int)Parses a column header equivalent to the regexp: \s*:\s*[delimiterChar]+\s*:\s*
ParseColumnHeaderAuto(StringSlice, char, TableColumnAlign?)Parses a column header equivalent to the regexp: \s*:\s*[delimiterChar]+\s*:\s*
ParseColumnHeaderDetect(StringSlice, char, TableColumnAlign?, int)Parses a column header equivalent to the regexp: \s*:\s*[delimiterChar]+\s*:\s*

ParseColumnHeader(StringSlice, char, TableColumnAlign?, int)

TableHelper.cs

Parses a column header equivalent to the regexp: \s*:\s*[delimiterChar]+\s*:\s*

public static bool ParseColumnHeader(ref StringSlice slice, char delimiterChar, out TableColumnAlign? align, out int delimiterCount)

Parameters

slice StringSlice
The text slice.
delimiterChar char
The delimiter character (either `-` or `=`).
align TableColumnAlign?
The alignment of the column.
delimiterCount int
The number of delimiters.

Returns

bool true if parsing was successful

ParseColumnHeaderAuto(StringSlice, char, TableColumnAlign?)

TableHelper.cs

Parses a column header equivalent to the regexp: \s*:\s*[delimiterChar]+\s*:\s*

public static bool ParseColumnHeaderAuto(ref StringSlice slice, out char delimiterChar, out TableColumnAlign? align)

Parameters

slice StringSlice
The text slice.
delimiterChar char
The delimiter character (either `-` or `=`).
align TableColumnAlign?
The alignment of the column.

Returns

bool true if parsing was successful

ParseColumnHeaderDetect(StringSlice, char, TableColumnAlign?, int)

TableHelper.cs

Parses a column header equivalent to the regexp: \s*:\s*[delimiterChar]+\s*:\s*

public static bool ParseColumnHeaderDetect(ref StringSlice slice, ref char delimiterChar, out TableColumnAlign? align, out int delimiterCount)

Parameters

slice StringSlice
The text slice.
delimiterChar char
The delimiter character (either `-` or `=`). If `\0`, it will detect the character (either `-` or `=`)
align TableColumnAlign?
The alignment of the column.
delimiterCount int
The number of times delimiterChar appeared in the column header.

Returns

bool true if parsing was successful