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

from_mutable_array

String.type.from_mutable_array

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.

Type Parameters

0.095dev (GIT hash bbe6a68d95a84558dff9b1de94c9fc34381e5515)
last changed: 2026-03-05