Skip to content

Commit 86fb1a6

Browse files
committed
chore: added convert with known type example
1 parent fa8bdbb commit 86fb1a6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ import (
2424

2525
func func main() {
2626
// Convert string to snake case -> returns "my_camel_case_string"
27+
// Input case style is automatically detected
2728
gocc.C("myCamelCaseString").ToSnakeCase()
29+
30+
// Convert with known input type
31+
// Using Convert function with known type is much faster than the example above,
32+
// because there is no need to detect the input type
33+
gocc.C("myCamelCaseString").Convert(gocc.StyleCamelCase, gocc.StyleSnakeCase)
2834

2935
// Validate strings -> returns true
3036
gocc.IsSnakeCase("my_snake_case_string")

0 commit comments

Comments
 (0)