mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-21 20:20:17 +01:00
init
This commit is contained in:
commit
3b23208ee0
23 changed files with 49288 additions and 0 deletions
26
codegen/string.go
Normal file
26
codegen/string.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package codegen
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
func firstUpper(str string) string {
|
||||
for i, r := range str {
|
||||
return string(unicode.ToUpper(r)) + str[i+1:]
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func firstLower(str string) string {
|
||||
for i, r := range str {
|
||||
return string(unicode.ToLower(r)) + str[i+1:]
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func underscoreToCamelCase(s string) string {
|
||||
return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue