class base string
extends debuggable
implements string
implements string text node
private String state
overload base string(String s1)
this • state = s1
overload base string(String s1, String s2)
this • state = s1 ++ s2
overload base string(String s1, String s2, String s3)
this • state = c(c(s1, s2), s3)
overload base string(String s1, String s2, String s3, String s4)
this • state = c(c(c(s1, s2), s3), s4)
overload base string(String s1, String s2, String s3, String s4, String s5)
this • state = c(c(c(c(s1, s2), s3), s4), s5)
overload base string(String s1, String s2, String s3, String s4, String s5, String s6)
this • state = c(c(c(c(c(s1, s2), s3), s4), s5), s6)
overload base string(String s1, String s2, String s3, String s4, String s5, String s6, String s7)
this • state = c(c(c(c(c(c(s1, s2), s3), s4), s5), s6), s7)
overload base string(string s1, string s2)
this • state = unbox(s1) ++ unbox(s2)
overload base string(string s1, string s2, string s3)
this • state = c(c(s1, s2), s3)
overload base string(string s1, string s2, string s3, string s4)
this • state = c(c(c(s1, s2), s3), s4)
overload base string(string s1, string s2, string s3, string s4, string s5)
this • state = c(c(c(c(s1, s2), s3), s4), s5)
overload base string(string s1, string s2, string s3, string s4, string s5, string s6)
this • state = c(c(c(c(c(s1, s2), s3), s4), s5), s6)
overload base string(String s1, string s2)
this • state = s1 ++ unbox(s2)
overload base string(string s1, String s2)
this • state = unbox(s1) ++ s2
overload base string(string s1, String s2, String s3)
this • state = c(c(s1, s2), s3)
overload base string(String s1, string s2, String s3)
this • state = c(c(s1, s2), s3)
overload base string(String s1, String s2, string s3)
this • state = c(c(s1, s2), s3)
overload base string(string s1, String s2, string s3)
this • state = c(c(s1, s2), s3)
overload base string(string s1, string s2, String s3)
this • state = c(c(s1, s2), s3)
overload base string(String s1, string s2, String s3, String s4, String s5)
this • state = c(c(c(c(s1, s2), s3), s4), s5)
String s()
return state
static String unbox(string the string)
return (the string !> base string) • s()
static overload String c(String s1, String s2)
return (s1 ++ s2) !> String
static overload String c(String s1, string s2)
return (s1 ++ unbox(s2)) !> String
static overload String c(string s1, string s2)
return (unbox(s1) ++ unbox(s2)) !> String
static overload String c(string s1, String s2)
return (unbox(s1) ++ s2) !> String
static string from list(readonly list[character] chars)
the writer : string writer • new()
the writerwrite all(chars)
return the writerelements()
The number of elements in the collection.
implement integer size => statelength()
Specifies whether the collection has zero elements.
implement boolean is empty => statelength() == 0
Specifies whether the collection has more than zero elements. Shortcut for !is_empty.
implement boolean is not empty => statelength() != 0
Access the first element of the list. Assumes the list is not empty.
implement character first()
assert is not empty
return statecharAt(0)
Access the last element of the list. Assumes the list is not empty.
implement character last()
assert is not empty
return statecharAt(statelength() - 1)
Read the list's element for the specified index.
implement implicit readonly reference[character] get(nonnegative index) pure
return statecharAt(index)
Enumerates elements in some collection-defined order. This method returns a snapshot of the collection state, so subsequent mutations of the collection do not cause changes in the returned list.
implement immutable list[character] elements()
return this
Returns an immutable copy of this list.
implement immutable list[character] frozen copy()
return this
Skips over the specified count of elements and returns an immutable slice that begins with count and ends with the end of this list.
implement string skip(nonnegative count)
return base string • new(statesubstring(count))
Returns an immutable sublist with the given the starting and ending indices.
The starting index is inclusive, the ending is exclusive.
implement string slice(nonnegative begin, nonnegative end)
return base string • new(statesubstring(begin, end))
Returns an immutable list with the order of the elements reversed.
implement string reverse()
return base string • new(StringBuilder • new(state) • reverse() • toString())
Check whether the list has at least one element that satisfies the predicate.
implement boolean has(predicate[character] the predicate) pure
for var nonnegative index : 0; index < statelength(); index += 1
if the predicate(statecharAt(index))
return true
return false
override boolean equals(Object other)
return other is base string && this • stateequals((other !> base string) • state)
implement string to string()
return this