mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-07 04:09:17 +02:00
23 fix only whitespaces + conditional attributes
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
package functions
|
||||
|
||||
import "unicode"
|
||||
import "strings"
|
||||
|
||||
// check if course is empty or contains only whitespaces
|
||||
// check if string is empty or contains only whitespaces
|
||||
func OnlyWhitespace(word string) bool {
|
||||
for _, letter := range word {
|
||||
if !unicode.IsSpace(letter) || !(letter == int32(160)) {
|
||||
return false
|
||||
}
|
||||
if len(strings.TrimSpace(word)) == 0 {
|
||||
return true
|
||||
}
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
func Contains(s []string, e string) bool {
|
||||
|
Reference in New Issue
Block a user