All operations

Case transform

Change letter case, in one direction only.

Why there is no way back

Sentence case is applied to the example above, and three names come out the other side as ordinary words: IT, HR and US are now it, hr and us. The text no longer records that they were ever anything else. Nothing can recover them, so this operation has no decode direction and never will.

Put a case transform early in a chain and everything after it inherits the loss.

The five styles

UPPERCASE and lowercase map every letter they can. Title Case raises the first letter of each word. Sentence case lowercases the whole input first, then raises the opening letter and every letter that follows a period, question mark or exclamation mark and at least one space. sWAP cASE flips each letter to the other case.

Where title and sentence case slip

Title case decides where a word starts using an ASCII test, which is the common shortcut and it shows. An apostrophe counts as a break, so didn't becomes Didn'T. Accented letters are not ASCII word characters, so résumés comes back as RéSuméS.

Sentence case needs that space to see a sentence ending. approx. three becomes Approx. Three, while the b in a.b stays lowercase.

One character in, two out

Uppercasing German ß produces SS, two characters where there was one, and lowercasing that gives ss. Swap case hits the same wall, which is why even sWAP cASE fails to undo itself: Straße swaps to sTRASSE, and swapping that gives Strasse with the ß gone.

The mapping is Unicode’s default and knows nothing about language. Turkish uses a dotless ı whose capital is I, so lowercasing an I here yields i, correct almost everywhere and wrong in Turkish. Comparing two strings by uppercasing both commits you to that default and to everything it merges: Straße and Strasse come out equal, which is one way two accounts a registration form meant to keep apart become one.

Replace will match without regard to case while leaving the surrounding text as it was. Unicode normalize is the other one-way rewrite here, folding characters that look alike into a single stored form.