On 18 April 2013 13:15, Chris Datfung <

[hidden email]> wrote:

>

> Hi,

>

> I want to pad a string with itself n number of times, for example if n = 3 and var="test" then var = var .. var .. var

>

> I tried with a for loop but get one too many combinations

>

> > a="k"

> > n=3

> > for c = 1, n-1 do a = a..a end

> > print(a)

> kkkk

>

> Is there a smarter way to implement this?

>

print(string.rep("k", 3))