]> git.lizzy.rs Git - micro.git/blob - util.go
Add statusline
[micro.git] / util.go
1 package main
2
3 import (
4         "unicode/utf8"
5 )
6
7 func count(s string) int {
8         return utf8.RuneCountInString(s)
9 }
10
11 func numOccurences(s string, c byte) int {
12         var n int
13         for i := 0; i < len(s); i++ {
14                 if s[i] == c {
15                         n++
16                 }
17         }
18         return n
19 }
20
21 func emptyString(n int) string {
22         var str string
23         for i := 0; i < n; i++ {
24                 str += " "
25         }
26         return str
27 }