resize-string ( n str -- newstr )
Factor handbook » The language » Collections » Strings

Prev:1string ( ch -- str )


Vocabulary
strings

Inputs
na non-negative integer
stra string


Outputs
newstra string


Word description
Resizes the string to have a length of n elements. When making the string shorter, this word may either create a new string or modify the existing string in place. When making the string longer, this word always allocates a new string, filling remaining space with zeroes.

Side effects
Modifies str

Definition

PRIMITIVE: resize-string ( n str -- newstr )