12

I know . operator concatenate strings.

But how to repeat a string N times, similar to "abc" * 3 in python?

1

1 Answer 1

21

To repeat a string you want to use the (appropriately named) function repeat()

The doc is here :h repeat()

And you can use it like that:

let foo = repeat("abc", 3)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.