mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-16 19:42:26 +01:00
added UserDefined Module Naming
This commit is contained in:
22
backend/service/functions/string.go
Normal file
22
backend/service/functions/string.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package functions
|
||||
|
||||
import "unicode"
|
||||
|
||||
// check if course is empty or contains only whitespaces
|
||||
func CheckIfOnlyWhitespace(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
|
||||
}
|
||||
Reference in New Issue
Block a user