Files
htwkalender/backend/service/functions/string.go
2023-09-22 16:31:12 +02:00

23 lines
381 B
Go

package functions
import "unicode"
// check if course is empty or contains only whitespaces
func OnlyWhitespace(word string) bool {
for _, letter := range word {
if !unicode.IsSpace(letter) || !(letter == int32(160)) {
return false
}
}
return true
}
func Contains(s []string, e string) bool {
for _, a := range s {
if a == e {
return true
}
}
return false
}