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 } func ReplaceEmptyString(word string, replacement string) string { if OnlyWhitespace(word) { return replacement } return word }