ICharIterator Interface

Provides a common interface for iterating characters over a StringSlice or StringLineGroup.

public interface ICharIterator

Properties

NameDescription
CurrentCharGets the current character.
EndGets the end character position.
IsEmptyGets a value indicating whether this instance is empty.
StartGets the current start character position.

CurrentChar

Gets the current character.

char CurrentChar { get; }

Property value

char

End

Gets the end character position.

int End { get; }

Property value

int

IsEmpty

Gets a value indicating whether this instance is empty.

bool IsEmpty { get; }

Property value

bool

Start

Gets the current start character position.

int Start { get; }

Property value

int

Methods

NameDescription
NextChar()Goes to the next character, incrementing the ICharIterator.Start position.
PeekChar()Peeks at the next character, without incrementing the ICharIterator.Start position.
PeekChar(int)Peeks at the next character, without incrementing the ICharIterator.Start position.
SkipChar()Goes to the next character, incrementing the ICharIterator.Start position.
TrimStart()Trims whitespaces at the beginning of this slice starting from ICharIterator.Start position.

NextChar()

Goes to the next character, incrementing the ICharIterator.Start position.

char NextChar()

Returns

char The next character. `\0` is end of the iteration.

PeekChar overloads

PeekChar()

Peeks at the next character, without incrementing the ICharIterator.Start position.

char PeekChar()
Returns

char The next character. `\0` is end of the iteration.

PeekChar(int)

Peeks at the next character, without incrementing the ICharIterator.Start position.

char PeekChar(int offset)
Parameters
offset int
Returns

char The next character. `\0` is end of the iteration.

SkipChar()

Goes to the next character, incrementing the ICharIterator.Start position.

void SkipChar()

TrimStart()

Trims whitespaces at the beginning of this slice starting from ICharIterator.Start position.

bool TrimStart()

Returns

bool true if it has reaches the end of the iterator