String
repeat

Repeats the given string n times.

Syntax

import { repeat } from '@opentf/std';
 
repeat(str: string, n = 1): string;

Examples

repeat('*', 3) //=> '***'
 
repeat('abc', 2) //=> 'abcabc'
 
repeat('abc', 0) //=> ''

Try