mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-07 04:09:17 +02: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