Skip to main content

STR

Repeats a string value.

Synopsis

STR(string,repeats)

Arguments

string An expression that resolves to a string or number.
repeats An expression that resolves to a positive integer specifying the number of repeats.

Description

The STR function replicates and concatenates a string multiple times. The number of repetitions is specified by the repeats argument. The repeats argument specifies the number of repeats as a positive integer. If repeats is a decimal number, it is truncated to an integer. The repeats string is parsed as an integer until a non-numeric character is encountered. Thus “7dwarves” is parsed as 7. If repeats is 0, a negative number, or a non-numeric string, STR returns a null string.

You can use the STRS function to perform the same operation on all of the elements of a dynamic array.

Examples

The following example uses the STR function to repeat a string:

PRINT STR("test",5)

It returns: testtesttesttesttest

See Also

FeedbackOpens in a new tab