Prose.CharIndexer

References
public sealed class Prose.CharIndexer
CharIndexer which always return the null char if the index is out of bounds. It's a good class for getting string characters without having to worry about out-of-bounds indices.

Constructors

CharIndexer

#
Create a new character indexer.
public CharIndexer(
text
)

Properties

Length

#
Gets the length of the string.
public int Length { get; }

Indexers

this[]

#
Gets a char in this string.
public char this[
index
] { get; }

this[]

#
Gets an entire string.
public string this[
index,
length
] { get; }

Methods

CharacterEquals

#
Test whether the indexer matches a string of characters at the given index.
public bool CharacterEquals(
index,
Index within indexer where the match begins.
characters
Characters to match.
)
True if characters are found at the given index.

DigitAt

#
Gets whether the character at the given index if a digit.
public bool DigitAt(
index,
regular = true,
If true, regular digits are accepted.
subscript = false,
If true, subscript digits are accepted.
superscript = false
If true, superscript digits are accepted.
)
True if the indexed character is a digit.

SignAt

#
Gets whether the character at the given index if a plus or minus sign.
public bool SignAt(
index,
regular = true,
If true, regular signs are accepted.
subscript = false,
If true, subscript signs are accepted.
superscript = false
If true, superscript signs are accepted.
)
True if the indexed character is a sign.