util/whitespace.go (12 lines of code) (raw):
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package util
import (
"unicode"
)
// ContainsSpace returns true if the specified string contains a space,
// false otherwise.
func ContainsSpace(s string) bool {
for _, r := range s {
if unicode.IsSpace(r) {
return true
}
}
return false
}