mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-17 14:27:12 +09:00
Merge pull request #697 from frankbraun/spaces
Implement Spaces() with with strings.Repeat()
This commit is contained in:
@@ -36,11 +36,7 @@ func NumOccurrences(s string, c byte) int {
|
||||
|
||||
// Spaces returns a string with n spaces
|
||||
func Spaces(n int) string {
|
||||
var str string
|
||||
for i := 0; i < n; i++ {
|
||||
str += " "
|
||||
}
|
||||
return str
|
||||
return strings.Repeat(" ", n)
|
||||
}
|
||||
|
||||
// Min takes the min of two ints
|
||||
|
||||
Reference in New Issue
Block a user