17 lines
270 B
Go
17 lines
270 B
Go
package iteration
|
|
|
|
import "strings"
|
|
|
|
func Repeat(character string, count int) string {
|
|
var repeated string
|
|
|
|
for i := 0; i < count; i++ {
|
|
repeated += character
|
|
}
|
|
return repeated
|
|
}
|
|
|
|
func StringsRepeat(s string, count int) string {
|
|
return strings.Repeat(s, count)
|
|
}
|