(s string)
| 148 | } |
| 149 | |
| 150 | func pascal(s string) string { |
| 151 | // Replace non-identifier separators with spaces, then Title-case and strip. |
| 152 | s = strings.ReplaceAll(s, "_", " ") |
| 153 | s = strings.ReplaceAll(s, "-", " ") |
| 154 | s = strings.ReplaceAll(s, ":", " ") |
| 155 | s = strings.ReplaceAll(s, ".", " ") |
| 156 | words := strings.Fields(s) |
| 157 | for i := range words { |
| 158 | words[i] = strings.ToUpper(words[i][:1]) + words[i][1:] |
| 159 | } |
| 160 | return strings.Join(words, "") |
| 161 | } |
no test coverage detected