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

Prev:1string ( ch -- str )


Inputs and outputs
na non-negative integer
stra string
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


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