Add some more actions

This commit is contained in:
Zachary Yedidia
2018-09-03 16:54:56 -04:00
parent 47c899ae46
commit cd229c1f5b
4 changed files with 62 additions and 2 deletions

View File

@@ -139,6 +139,11 @@ func IsWordChar(r rune) bool {
return (r >= '0' && r <= '9') || (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r == '_')
}
// Spaces returns a string with n spaces
func Spaces(n int) string {
return strings.Repeat(" ", n)
}
// IsSpaces checks if a given string is only spaces
func IsSpaces(str []byte) bool {
for _, c := range str {