ToCamel converts the input text into camel case
()
| 62 | |
| 63 | // ToCamel converts the input text into camel case |
| 64 | func (s String) ToCamel() string { |
| 65 | list := s.splitBy(func(r rune) bool { |
| 66 | return r == '_' |
| 67 | }, true) |
| 68 | var target []string |
| 69 | for _, item := range list { |
| 70 | target = append(target, From(item).Title()) |
| 71 | } |
| 72 | return strings.Join(target, "") |
| 73 | } |
| 74 | |
| 75 | // ToSnake converts the input text into snake case |
| 76 | func (s String) ToSnake() string { |