StringRange
Updated 218 Days AgoPublic

Core

Properties


All : StringRange

read-only

Zilch
var All : StringRange

Begin : RuneIterator

read-only

Returns the RuneIterator at the start of this range.

Zilch
var Begin : RuneIterator

Current : Rune

read-only

Zilch
var Current : Rune

Empty : Boolean

read-only

Zilch
var Empty : Boolean

End : RuneIterator

read-only

Returns the RuneIterator at the end (one past the last Rune) of this range.

Zilch
var End : RuneIterator

IsNotEmpty : Boolean

read-only

Zilch
var IsNotEmpty : Boolean

OriginalString : String

read-only

Returns the entire string that this range was constructed from.

Zilch
var OriginalString : String

Methods


Compare : Integer

static

Compares the two string ranges and returns an integer to denote their relative sort order.

NameTypeDescription
leftStringRange
rightStringRange
Zilch
function Compare(left : StringRange, right : StringRange) : Integer

CompareTo : Integer

Returns if this string range is equal to the given range.

NameTypeDescription
p0StringRange
Zilch
function CompareTo(p0 : StringRange) : Integer

Contains : Boolean

Returns if the string Contains the specified substring.

NameTypeDescription
p0StringRange
Zilch
function Contains(p0 : StringRange) : Boolean

EndsWith : Boolean

Returns if the string ends with the specified substring.

NameTypeDescription
p0StringRange
Zilch
function EndsWith(p0 : StringRange) : Boolean

FindFirstOf : StringRange

Returns a StringRange that Contains the first occurrence of given StringRange.

NameTypeDescription
p0StringRange
Zilch
function FindFirstOf(p0 : StringRange) : StringRange

FindLastOf : StringRange

Returns a StringRange that Contains the last occurrence of given StringRange.

NameTypeDescription
p0StringRange
Zilch
function FindLastOf(p0 : StringRange) : StringRange

FindRangeExclusive : StringRange

Finds the first StringRange that starts with 'startRange' and ends with 'endRange'. This substring excludes 'startRange' and 'endRange'.

NameTypeDescription
startRangeStringRange
endRangeStringRange
Zilch
function FindRangeExclusive(startRange : StringRange, endRange : StringRange) : StringRange

FindRangeInclusive : StringRange

Finds the first StringRange that starts with 'startRange' and ends with 'endRange'. This substring includes 'startRange' and 'endRange'.

NameTypeDescription
startRangeStringRange
endRangeStringRange
Zilch
function FindRangeInclusive(startRange : StringRange, endRange : StringRange) : StringRange

MoveNext : Void

NameTypeDescription
Zilch
function MoveNext()

Replace : String

Returns a new string with all occurances of a substrings replaced with another substring.

NameTypeDescription
oldValueStringRange
newValueStringRange
Zilch
function Replace(oldValue : StringRange, newValue : StringRange) : String

RuneIteratorFromByteIndex : RuneIterator

Finds the iterator from a byte index. WARNING: Strings are UTF8 and constructing an iterator from bytes indices can make an iterator in the middle of a rune.

NameTypeDescription
byteIndexInteger
Zilch
function RuneIteratorFromByteIndex(byteIndex : Integer) : RuneIterator

RuneIteratorFromRuneIndex : RuneIterator

Finds the iterator from a rune index (the 'character' index). WARNING: this may be slow as finding an iterator from rune index requires a linear search.

NameTypeDescription
runeIndexInteger
Zilch
function RuneIteratorFromRuneIndex(runeIndex : Integer) : RuneIterator

Split : StringSplitRange

Splits the string, according to the separator string, into a range of substrings.

NameTypeDescription
separatorStringRange
Zilch
function Split(separator : StringRange) : StringSplitRange

StartsWith : Boolean

Returns if the string ends with the specified substring.

NameTypeDescription
p0StringRange
Zilch
function StartsWith(p0 : StringRange) : Boolean

StringRange : Void

constructor

NameTypeDescription
Zilch
function StringRange()

SubString : StringRange

Constructs a StringRange from the given begin and end iterators.

NameTypeDescription
beginRuneIterator
endRuneIterator
Zilch
function SubString(begin : RuneIterator, end : RuneIterator) : StringRange

SubStringBytes : StringRange

Constructs a substring based upon a number of bytes. WARNING: strings are UTF8 so indexing by bytes could produce unexpected results on non-ascii strings.

NameTypeDescription
startByteIndexInteger
lengthInBytesInteger
Zilch
function SubStringBytes(startByteIndex : Integer, lengthInBytes : Integer) : StringRange

ToLower : String

Returns a copy of the string that has been converted to lowercase.

NameTypeDescription
Zilch
function ToLower() : String

ToString : String

Returns a new string of the current range.

NameTypeDescription
Zilch
function ToString() : String

ToUpper : String

Returns a copy of the string that has been converted to uppercase.

NameTypeDescription
Zilch
function ToUpper() : String

Trim : StringRange

Trims all leading and trailing whitespace.

NameTypeDescription
Zilch
function Trim() : StringRange

TrimEnd : StringRange

Trims all trailing whitespace.

NameTypeDescription
Zilch
function TrimEnd() : StringRange

TrimStart : StringRange

Trims all leading whitespace.

NameTypeDescription
Zilch
function TrimStart() : StringRange

Last Author
arend.danielek
Last Edited
Jul 13 2018, 12:25 PM
Projects
Subscribers
None