Use stdlib Repeat function
This commit is contained in:
@@ -12,10 +12,6 @@ func Repeat(character string, count int) string {
|
|||||||
if count == 0 {
|
if count == 0 {
|
||||||
count = defaultRepeatCount
|
count = defaultRepeatCount
|
||||||
}
|
}
|
||||||
var repeated strings.Builder
|
|
||||||
for range count {
|
|
||||||
repeated.WriteString(character)
|
|
||||||
}
|
|
||||||
|
|
||||||
return repeated.String()
|
return strings.Repeat(character, count)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user