StringTemplate doesn't have built-in operators for repeating. Instead, you'll need to iterate, like described in the following question.
Is there anything like Enumerable.Range(x,y) in Java?
Keep in mind that you'll need to pass an Iterator<T>
and not an Iterable<T>
due to a current limitation in StringTemplate (the interpreter supports Collection<T>
, but not Iterable<T>
). If you want to use the built-in iteration variable i
or i0
, you could also pass an appropriately sized new Object[n]
.