github.com/altipla-consulting/ravendb-go-client@v0.1.3/string_utils.go (about)

     1  package ravendb
     2  
     3  import "unicode"
     4  
     5  // Go port of org.apache.commons.lang3.StringUtils
     6  
     7  // TODO: replace with direct code
     8  func stringIsEmpty(s string) bool {
     9  	return s == ""
    10  }
    11  
    12  // TODO: replace with direct code
    13  func stringIsNotEmpty(s string) bool {
    14  	return s != ""
    15  }
    16  
    17  func stringIsWhitespace(s string) bool {
    18  	for _, c := range s {
    19  		if !unicode.IsSpace(c) {
    20  			return false
    21  		}
    22  	}
    23  	return true
    24  }
    25  
    26  func stringIsBlank(s string) bool {
    27  	for _, c := range s {
    28  		if c != ' ' {
    29  			return false
    30  		}
    31  	}
    32  	return true
    33  }
    34  
    35  func stringIsNotBlank(s string) bool {
    36  	return !stringIsBlank(s)
    37  }