mirror of https://github.com/gobeam/stringy.git
parent
9dd1f5ca32
commit
82896f05d5
|
@ -7,10 +7,11 @@ import (
|
|||
"unicode"
|
||||
)
|
||||
|
||||
var selectCapitalRegexp = regexp.MustCompile(SelectCapital)
|
||||
|
||||
func caseHelper(input string, isCamel bool, rule ...string) []string {
|
||||
if !isCamel {
|
||||
re := regexp.MustCompile(SelectCapital)
|
||||
input = re.ReplaceAllString(input, ReplaceCapital)
|
||||
input = selectCapitalRegexp.ReplaceAllString(input, ReplaceCapital)
|
||||
}
|
||||
input = strings.Join(strings.Fields(strings.TrimSpace(input)), " ")
|
||||
if len(rule) > 0 && len(rule)%2 != 0 {
|
||||
|
|
Loading…
Reference in New Issue