Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsComplexCase ¶
IsComplexCase returns true if s is in one of the recognized naming conventions: PascalCase, camelCase, snake_case, kebab-case, Header-Case, or hybrid_Case.
func IsHybridCase ¶
IsHybridCase returns true if the string contains a mix of separators (e.g., both "-" and "_") and a mix of casing that does not conform strictly to one of the standard conventions.
func SplitWords ¶
SplitWords attempts to split an input string into words. It handles strings that use underscores, hyphens, or camel/pascal style, and works well for hybrid cases (mixing these conventions).
func TransformTo ¶
TransformTo transforms a given string into a target Case. It supports determined cases only, but not Hybrid. For Hybrid use TransformToHybrid.
Types ¶
type Case ¶
type Case string
Case defines the target naming convention.
const ( Snake Case = "snake" // e.g. "hello_world" Camel Case = "camel" // e.g. "helloWorld" Pascal Case = "pascal" // e.g. "HelloWorld" Kebab Case = "kebab" // e.g. "hello-world" Header Case = "header" // e.g. "Hello-World" TitleSnake Case = "title_snake" // e.g. "Hello_World" Hybrid Case = "hybrid" // e.g. "Hello_beautiful-WorldHere" )