mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-22 09:45:27 -04:00
15 lines
295 B
Go
15 lines
295 B
Go
package parser
|
|
|
|
import "strings"
|
|
|
|
func SnakeToCamel(s string) string {
|
|
s = strings.ReplaceAll(s, "-", "_")
|
|
s = strings.ReplaceAll(s, " ", "_")
|
|
|
|
words := strings.Split(s, "_")
|
|
for i, word := range words {
|
|
words[i] = strings.ToUpper(word[:1]) + word[1:]
|
|
}
|
|
return strings.Join(words, "")
|
|
}
|