2024-09-10 11:20:33 +00:00
|
|
|
package iteration
|
|
|
|
|
|
|
|
// Repeat takes a string and repeat it 5 times
|
2024-09-10 11:32:46 +00:00
|
|
|
func Repeat(s string, repeatTime int) string {
|
2024-09-10 11:20:33 +00:00
|
|
|
var res string
|
|
|
|
for i := 0; i < repeatTime; i++ {
|
|
|
|
res += s
|
|
|
|
}
|
|
|
|
return res
|
|
|
|
}
|