go-by-test/iteration/iter.go

11 lines
192 B
Go
Raw Normal View History

package iteration
// Repeat takes a string and repeat it 5 times
func Repeat(s string, repeatTime int) string {
var res string
for i := 0; i < repeatTime; i++ {
res += s
}
return res
}