2020-08-05 17:14:10 +00:00
|
|
|
package main
|
|
|
|
|
2020-09-01 16:53:21 +00:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2020-08-05 17:14:10 +00:00
|
|
|
type stringSlice []string
|
|
|
|
|
|
|
|
func (s stringSlice) has(value string) bool {
|
|
|
|
for _, v := range s {
|
|
|
|
if v == value {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
2020-09-01 16:53:21 +00:00
|
|
|
|
|
|
|
func urlize(str string) string {
|
|
|
|
newStr := ""
|
|
|
|
for _, c := range strings.Split(strings.ToLower(str), "") {
|
|
|
|
if c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" {
|
|
|
|
newStr += c
|
|
|
|
} else if c == " " {
|
|
|
|
newStr += "-"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return newStr
|
|
|
|
}
|