lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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?

Thanks,
Chris