Commit fa865f4

mo khan <mo.khan@gmail.com>
2019-10-26 18:02:55
https://golang.org/pkg/strings/#Repeat
1 parent 1e52b71
Changed files (1)
repeat.go
@@ -1,9 +1,7 @@
 package main
 
+import "strings"
+
 func Repeat(character string, times int) string {
-  var repeated string
-  for i := 0; i < times; i++ {
-    repeated += character
-  }
-  return repeated
+  return strings.Repeat(character, times)
 }