mirror of
https://github.com/foomo/gocontentful.git
synced 2025-10-16 12:25:39 +00:00
21 lines
353 B
Go
21 lines
353 B
Go
package erm
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
var onlyLettersRegex = regexp.MustCompile("[^A-Za-z]")
|
|
|
|
func sliceIncludes(slice []string, key string) bool {
|
|
for _, val := range slice {
|
|
if val == key {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func onlyLetters(inputString string) (outputString string) {
|
|
return onlyLettersRegex.ReplaceAllString(inputString, "")
|
|
}
|