SubString

TheArtOfDev.HtmlRenderer.Core.Utils

Represents sub-string of a full string starting at specific location with a specific length.

コンストラクター

SubString(string)

Init sub-string that is the full string.

fullString
the full string that this sub-string is part of
SubString(string, int, int)

Init.

fullString
the full string that this sub-string is part of
startIdx
the start index of the sub-string
length
the length of the sub-string starting at

プロパティ

FullString : string

the full string that this sub-string is part of

Item : char

Get string char at specific index.

idx
the idx to get the char at

戻り値: char at index

Length : int

the length of the sub-string starting at _startIdx

StartIdx : int

the start index of the sub-string

メソッド

CutSubstring() : string

Get a string of the sub-string. This will create a new string object!

戻り値: new string that is the sub-string represented by this instance

IsEmpty() : bool

Is the sub-string is empty string.

戻り値: true - empty string, false - otherwise

IsEmptyOrWhitespace() : bool

Is the sub-string is empty string or contains only whitespaces.

戻り値: true - empty or whitespace string, false - otherwise

IsWhitespace() : bool

Is the sub-string contains only whitespaces (at least one).

戻り値: true - empty or whitespace string, false - otherwise

Substring(int, int) : string

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

startIdx
The zero-based starting character position of a substring in this instance.
length
The number of characters in the substring.

戻り値: A String equivalent to the substring of length length that begins at startIndex in this instance, or Empty if startIndex is equal to the length of this instance and length is zero.

フィールド

_fullString : string

the full string that this sub-string is part of

_length : int

the length of the sub-string starting at _startIdx

_startIdx : int

the start index of the sub-string