padBlanks

padBlanks(int: Integer): StringUtf8;

The padBlanks method of the StringUtf8 primitive type returns a string of the length specified in the int parameter, consisting of the receiving string padded with appended (trailing) spaces.

If the string is longer than the integer value, it is not truncated but the whole string is returned.

The following example shows the use of the padBlanks method.

vars
    str8 : StringUtf8;
begin
    str8 := @'Alfonso:';
    write str8.padBlanks(10) & '123 Sesame St.';
    // Outputs 'Alfonso:  123 Sesame St.'
end;