github.com/jshiv/can-go@v0.2.1-0.20210224011015-069e90e90bdf/internal/identifiers/case.go (about)

     1  package identifiers
     2  
     3  import "unicode"
     4  
     5  func IsCamelCase(s string) bool {
     6  	i := 0
     7  	for _, r := range s {
     8  		if unicode.IsDigit(r) {
     9  			continue
    10  		}
    11  		if i == 0 && !unicode.IsUpper(r) || !IsAlphaChar(r) && !IsNumChar(r) {
    12  			return false
    13  		}
    14  		i++
    15  	}
    16  	return true
    17  }