Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

string

🌌string

string -- immutable sequences of utf8 encoded unicode characters
convert this string into a Sequence of codepoint and errors for encoding problems
found in the underlying utf8 bytes
converting a string to a string is just returning string.this
redefines Object.asString:
length of this string in bytes
length of this string in codepoints
convert this string into a list of codepoint and errors for encoding problems
found in the underlying utf8 bytes
the list instance returned by asCodepoints
convert this string into an array of codepoints.
does this string contain the given 'substring'
count number of occurrences of given 'substring' in this string
Cuts out the first appearance of the string sep from this string, in other words,
returns a tuple of two strings and a bool, the first string is the substring before
the first appreance of sep, the second string is the substring after the first
appearance of sep. The bool result is true iff sep appears in this string.

If sep does not appear in this string at all, return this string as the first string,
the empty string as the second, and false as the bool.
is this part of given set
check if this string ends with given suffix
Splits this string at codepoints where p is true and returns the result as a
list of strings. In case multiple, neighboring codepoints in the string are
evaluated to be true by p, this does not cause empty strings to be added to
the result list, rather this case is being treated as being one big separator.
find (utf8-byte-) index of 'substring' witin this string.
find (utf8-byte-) index of last occurrence of 'substring'
within this string.
find (utf8-byte-) index of last occurrence of 'substring'
within this string.
create hash code from a string
redefines hasHash.hash:
create hash code for this instance
repeat string given number of times
concatenate string with string representation of another object
does this come before other?

This defines a total order over strings that is unrelated to alphabetic order.
redefines partiallyOrdered.infix <=:
does this come before other?
compare string byte-by-byte with other string
redefines partiallyOrdered.infix =:
equality check for immutable values
redefines hasEquals.infix =:
equality check for immutable values
is c an ASCII white-space character?
returns true if string is empty or contains whitespace only
is this string empty?
is this not part of given set

redefines partiallyOrdered.orderedThis:
get value of type P.

NYI: #167: Once Eiffel-style 'like this' works, we can use 'like this' instead of
T and no longer need this feature.
return string of at least length l by
padding codepoint s to start of string
parse this string as a signed 32-bit integer value
parse this string as a signed 64-bit integer value
parse this string as an int value of arbitrary size
§  parse_integer(T (integer string.parse_integer.T).
type
, base T)
 => 
outcome string.parse_integer.T
:
Object 
parse this string as a integer value given as type parameter
§  parse_integer(T (integer string.parse_integer.T).
type
, base T, neg bool, hi numOption string.parse_integer.T, c u8, s list u8)
 => 
outcome string.parse_integer.T
:
Object 
recursive helper for parse_integer T
parse this string as an unsigned 32-bit integer value
parse this string as an unsigned 64-bit integer value
internal helper to create error for failed parsing
replace all occurrences of old by new
replace the first n occurrences of old by new
Split string separated by (ASCII) white space

Leading and trailing white space is ignored, repeated white space is treated
like a single white space

The result is a, possibly empty, list of separate non-empty strings.
split string at s
check if this string starts with given prefix
create substring of this string consisting of bytes from (inclusive) .. to (exclusive).
create substring of this string consisting of bytes from (inclusive) .. byteLength (exclusive).
create substring of the string consisting of bytes from (inclusive) .. to (exclusive).
create substring of this string consisting of codepoints from (inclusive) .. to (exclusive).
create substring of this string consisting of codepoints from (inclusive) .. codepointLength (exclusive).
replaces runs of invalid UTF-8 byte sequences in this string with the Unicode
replacement character (U+FFFD).
replaces runs of invalid UTF-8 byte sequences in this string with the given
string.
remove leading and trailing white space from this string
remove trailing white space from this string
remove leading white space from this string
any concrete string must implement utf8