mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-05-01 09:31:28 +08:00
支持tdengine
This commit is contained in:
17
pkg/tool/base.go
Normal file
17
pkg/tool/base.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package tool
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ToCamelCase(s string) string {
|
||||
re := regexp.MustCompile(`[_\W]+`)
|
||||
words := re.Split(s, -1)
|
||||
for i := range words {
|
||||
if i != 0 {
|
||||
words[i] = strings.Title(words[i])
|
||||
}
|
||||
}
|
||||
return strings.Join(words, "")
|
||||
}
|
||||
Reference in New Issue
Block a user