repeat function

String repeat(
  1. String string,
  2. int n
)

Repeats the given string n times.

Implementation

String repeat(String string, int n) {
  return List.filled(n, string).join();
}