在 Go 中将 camelcase 单词分割成多个单词片段
CamelCase is a Go package to split the words of a camelcase type string into a slice of words. It can be used to convert a camelcase word (lower or upper case) into any type of word.
go get github.com/fatih/camelcasesplitted := camelcase.Split("GolangPackage")
fmt.Println(splitted[0], splitted[1]) // prints: "Golang", "Package"Both lower camel case and upper camel case are supported. For more info please check: http://en.wikipedia.org/wiki/CamelCase
Below are some example cases:
…暂无开放 Issues,或尚未同步最近议题。