STRING$ function

Purpose

Return a string consisting of multiple copies of the specified character.

Syntax

s$ = STRING$(count, {code | string_expression})

Remarks

STRING$ with a numeric argument returns a string of count copies of the character with the ASCII code of code, where code is between 0 and 255, inclusive.

STRING$ with a string argument returns a string of count copies of the first character in string_expression.

The following functions all return a string of 8 spaces:

A$ = STRING$(8, 32)

A$ = STRING$(8, " ")

A$ = STRING$(8, $SPC)

A$ = SPACE$(8)

A$ = REPEAT$(8, " ")

A$ = REPEAT$(8, $SPC)

Use REPEAT$ to make multiple copies of a multiple-character string, and SPACE$ to return a string of space characters.

See also

ASC, CHR$, NUL$, REPEAT$, SPACE$