Eight ways to case a string, by hand
A variable name, a URL slug and a constant are the same words wearing different clothes. Once you can split a phrase into its words, every casing style — UPPERCASE, Title Case, camelCase, snake_case, kebab-case, CONSTANT_CASE — is just a choice of separator and capitalization applied to that same list. No tool required, just two steps done by hand.
The method
- Split the phrase into words on spaces, hyphens, underscores or a change from lowercase to uppercase (so
myVariableNamesplits the same way asmy variable name). - Decide the separator: a space, nothing, an underscore, or a hyphen.
- Decide the capitalization rule for each word: leave it alone, lowercase it, uppercase it, or capitalize just the first letter.
- Apply the same two rules to every word and join them.
A worked example
Take the phrase "the gg network". Split on spaces: three words, the, gg, network. Counting characters: 14 total including the two spaces, 12 without them (3 + 2 + 7 = 12 letters).
- UPPERCASE (separator: space, rule: uppercase every word):
THE GG NETWORK - lowercase (separator: space, rule: lowercase every word):
the gg network - Title Case (separator: space, rule: capitalize first letter):
The Gg Network - camelCase (separator: nothing, rule: lowercase the first word, capitalize the first letter of the rest):
theGgNetwork - snake_case (separator: underscore, rule: lowercase every word):
the_gg_network - kebab-case (separator: hyphen, rule: lowercase every word):
the-gg-network - CONSTANT_CASE (separator: underscore, rule: uppercase every word):
THE_GG_NETWORK
Every one of those seven strings is built from the same three words, the same way a Case Converter does it — split, then reapply a separator and a capitalization rule.
Where the split rule actually matters
The tricky part by hand isn't the joining, it's splitting something that is already in camelCase or an acronym. HTTPServer should split into HTTP and Server, not H, T, T, P, Server — the rule is to treat a run of uppercase letters followed by a lowercase letter as "the last uppercase letter starts a new word." Get the split wrong and every casing style downstream inherits the mistake, which is exactly why doing one careful conversion by hand before trusting a batch rename is worth the extra minute.
Why this is worth knowing
Renaming a variable, a database column, or a batch of filenames across styles is one of the more common small chores in programming and content work, and it's entirely mechanical. Knowing the rule means you can sanity-check a rename by eye instead of trusting a script blindly — and it's faster to convert one string in your head than to open a tool for it.