gg
Home › Blog › Eight ways to case a string, by hand

Eight ways to case a string, by hand

2026-10-15 · 2 min read
writingdeveveryday

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

  1. Split the phrase into words on spaces, hyphens, underscores or a change from lowercase to uppercase (so myVariableName splits the same way as my variable name).
  2. Decide the separator: a space, nothing, an underscore, or a hyphen.
  3. Decide the capitalization rule for each word: leave it alone, lowercase it, uppercase it, or capitalize just the first letter.
  4. 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).

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.

Try it free — with the steps shown

The Case Converter runs in your browser and shows exactly how it got the answer, so the method sticks.

Open Case Converter

More from the blog