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

strings

🌌strings

strings -- unit type defining features related to string but not
requiring an instance

monoid of strings with infix + operation.

monoid of strings with infix '+ sep +' operation, i.e., concatenate with
given separator

create string by concatenating the results of $a[a.indices].

This uses a growing array if further strings are appended using 'infix +',
so it avoids quadratic runtime caused if each 'infix +' would create its
own concatenation-string.

The performance of creating a string a0+a1+a2+...+a<n> is in O(n) since the
backing array is shared and doubled in size when full (so the final array size
is less than 2n in size and the sum of all arrays is less than 4n = 2n + n +
n/2+n/4+...).

The performance of iterating the utf8 bytes of a string is O(l+n) for an
array of length l created by concatenating n sub-strings.

create string from the given utf8 bytes

create string from the given codepoints

NYI: remove the convenience functions when Fuzion supports char literals