What You’ll Learn in This Module

Company names are one of the most visible pieces of data in any Cast narration — they appear in welcome slides, spoken greetings, and benchmark summaries. But CRM data is messy: names arrive in ALL CAPS, inconsistent casing, or with garbled formatting. The cast_titlecase filter is Cast’s purpose-built solution for transforming any company name into clean, professional title case.

đź“– https://school.cast.app/liquid/custom-cast-filters.html#cast_titlecase


What Is cast_titlecase?

The cast_titlecase filter converts company and account names to proper title case — capitalizing the first letter of most words while handling the dozens of special cases that make company names tricky: legal suffixes (LLC, GmbH, Inc.), acronyms (AI, API, AT&T), name prefixes (McDonald, O’Neill), and English particles (of, the, and).

This is not the same as Liquid’s built-in capitalize filter, which only uppercases the very first character of the string. cast_titlecase is specifically designed for the kinds of names that live in Salesforce, Gainsight, HubSpot, and other CRMs.

Excel analogy: Excel’s =PROPER("ACME LLC") would give you “Acme Llc” — incorrectly lowercasing the legal suffix. cast_titlecase knows that “LLC” should stay uppercase, that “GmbH” has a specific casing, and that “McDonald” needs an internal capital.

Why it matters in Cast

A narration that says “Welcome to ACME LLC’s review” or “Welcome to Acme Llc’s review” looks unprofessional. cast_titlecase produces “Welcome to Acme LLC’s review” — which is correct and polished. When a narrator speaks “ACME LLC,” it sounds like shouting. Proper casing produces natural, professional audio.


Basic Usage


{{ contact_account_name | cast_titlecase }}

That’s it. One filter handles all the complexity. Let’s look at what it does internally.


What cast_titlecase Handles

ALL CAPS normalization

The filter always normalizes ALL-CAPS input first, then applies title casing rules:


{{ "ACME CORP" | cast_titlecase }}        → Acme Corp
{{ "GLOBAL SOLUTIONS GROUP" | cast_titlecase }}  → Global Solutions Group

English particles (lowercased mid-name)

Common particles — of, the, and, at, for, in, by — are lowercased when they appear in the middle of a name. They’re still capitalized if they’re the first or last word:


{{ "BANK OF AMERICA" | cast_titlecase }}          → Bank of America
{{ "THE HOME DEPOT" | cast_titlecase }}            → The Home Depot
{{ "BREAD AND BUTTER LLC" | cast_titlecase }}      → Bread and Butter LLC

Legal suffixes and well-known acronyms stay in all caps:

LLC, LLP, LP, PLC, AB, AG, SA, SE, NV, BV, SAS, US, UK, EU, AI, API, IP, R&D, AT&T


{{ "ACME LLC" | cast_titlecase }}          → Acme LLC
{{ "AI SOLUTIONS GROUP" | cast_titlecase }} → AI Solutions Group
{{ "AT&T SERVICES LLC" | cast_titlecase }}  → AT&T Services LLC

Common corporate suffixes are cased in their conventional form:

Inc, Inc., Corp, Corp., Ltd, Ltd., GmbH, Oy, Co, Co., Company, Corporation, Limited


{{ "ACME GMBH" | cast_titlecase }}          → Acme GmbH
{{ "SMITH CORPORATION" | cast_titlecase }}   → Smith Corporation
{{ "JONES LTD." | cast_titlecase }}          → Jones Ltd.

Name prefixes (Mc, Mac)

Names starting with “Mc” or “Mac” followed by a capital get the correct internal capitalization:


{{ "MCDONALD CORP" | cast_titlecase }}       → McDonald Corp
{{ "MCCARTHY HOLDINGS" | cast_titlecase }}    → McCarthy Holdings

Apostrophe prefixes (O’, D’, L’)

Names with apostrophe prefixes are handled correctly:


{{ "O'NEILL MEDIA LLC" | cast_titlecase }}       → O'Neill Media LLC
{{ "D'ARCY HOLDINGS INC." | cast_titlecase }}    → D'Arcy Holdings Inc.
{{ "L'ENFANT PARTNERS" | cast_titlecase }}       → L'Enfant Partners

Hyphenated names

Each part of a hyphenated name is capitalized individually:


{{ "SMITH-JONES LLC" | cast_titlecase }}    → Smith-Jones LLC


Real Cast Examples

Welcome slide opening:


Welcome to {{ contact_account_name | cast_titlecase | cast_apostrophe }}
Executive Business Review.

For "BANK OF AMERICA" → Welcome to Bank of America's Executive Business Review. For "AT&T SERVICES LLC" → Welcome to AT&T Services LLC's Executive Business Review. For "O'NEILL MEDIA LLC" → Welcome to O'Neill Media LLC's Executive Business Review.

Benchmark comparison:


{%- assign company = contact_account_name | cast_titlecase -%}
{{ company }} outperformed 80% of companies in your industry segment.

For "ACME GMBH" → Acme GmbH outperformed 80% of companies in your industry segment.


Complete Example Reference

Here’s a comprehensive table showing input → output for cast_titlecase:

Input (CRM value) Output
"ACME LLC" Acme LLC
"BANK OF AMERICA" Bank of America
"ACME GMBH" Acme GmbH
"AT&T SERVICES LLC" AT&T Services LLC
"O'NEILL MEDIA LLC" O'Neill Media LLC
"MCDONALD CORP" McDonald Corp
"D'ARCY HOLDINGS INC." D'Arcy Holdings Inc.
"AI SOLUTIONS GROUP" AI Solutions Group
"SMITH-JONES LLC" Smith-Jones LLC
"GLOBAL SOLUTIONS GROUP" Global Solutions Group

Known Limitations

Non-English particles are capitalized

The filter handles English particles (of, the, and, etc.) correctly, but non-English particles (van, der, de, la, le) are capitalized rather than lowercased:


{{ "VAN DER MEER GROUP" | cast_titlecase }}   → Van Der Meer Group

The conventional spelling would be “Van der Meer Group” (lowercase der), but cast_titlecase capitalizes it. Similarly:


{{ "DE LA CRUZ PARTNERS" | cast_titlecase }}  → De La Cruz Partners

Instead of “de la Cruz Partners.” If your customer base includes many names with non-English particles, be aware of this behavior.

Errors on empty or whitespace-only input

⚠️ cast_titlecase will error if the input is nil, empty, or contains only whitespace. Always chain default before it:


{{ contact_account_name | default: "your company" | cast_titlecase }}


Common Mistakes

❌ Using capitalize instead of cast_titlecase for company names:


{{ "ACME LLC" | capitalize }}    → ACME LLC (unchanged — first char was already uppercase)
{{ "acme llc" | capitalize }}    → Acme llc (only first letter, "llc" stays lowercase)

âś… Use cast_titlecase for company names:


{{ "ACME LLC" | cast_titlecase }}  → Acme LLC
{{ "acme llc" | cast_titlecase }}  → Acme LLC


❌ Applying cast_titlecase to a nil field:


{{ contact_account_name | cast_titlecase }}

Errors if the field is nil or empty.

âś… Always default first:


{{ contact_account_name | default: "your company" | cast_titlecase }}


❌ Applying cast_titlecase to non-company text (like sentences):


{{ "WELCOME TO YOUR REVIEW" | cast_titlecase }}  → Welcome to Your Review

This works but may produce unexpected results — cast_titlecase is optimized for company names, not general text. For general text, use downcase | capitalize or write the text normally.


Try It Yourself

Exercise: You have three account names:

  • "JOHNSON AND JOHNSON"
  • "mcdonald's restaurants llc"
  • "" (empty string)

Write Liquid that safely displays each one with cast_titlecase, with a fallback for the empty one.

Click to reveal the answer ```liquid {{ "JOHNSON AND JOHNSON" | cast_titlecase }} → Johnson and Johnson {{ "mcdonald's restaurants llc" | cast_titlecase }} → McDonald's Restaurants LLC {{ "" | default: "Unknown Company" | cast_titlecase }} → Unknown Company ``` Key details: - "and" is lowercased as an English particle - "mcdonald's" gets the Mc prefix handling - "llc" is recognized and uppercased to "LLC" - The empty string gets a `default` before `cast_titlecase` to avoid an error

What’s Next

In Module 9, you’ll learn about cast_apostrophe — the filter that adds grammatically correct possessives to any name, handling both “Jason’s” and “James’” automatically.


đź“– Official documentation:

  • Custom Cast Filters: https://school.cast.app/liquid/custom-cast-filters.html#cast_titlecase

This site uses Just the Docs, a documentation theme for Jekyll.