REPEAT Function

── REPEAT ── ( ──<string expression>── , ──<arithmetic expression>─────►
►─ ) ──────────────────────────────────────────────────────────────────┤

The REPEAT function returns a string according to the following rules:

  • If the arithmetic expression equals 0, the result of the REPEAT function is the null string.

  • If the arithmetic expression is greater than 0, the result of the REPEAT function is the same as if <arithmetic expression> occurrences of the value of the string expression were all concatenated together.

  • If the arithmetic expression is less than 0, the result of the REPEAT function is either a compile-time or a run-time error.

The value of the arithmetic expression is rounded to an integer, if necessary, before it is used as the repeat count.

Examples of the REPEAT Function

REPEAT("ABC",3) = "ABCABCABC"

REPEAT("WON̍T WORK",0) = the null string