How to capitalize? (sometimes it does not work)

Hi, I am trying to use the nocode “capitalize” formula.

What I want is for example: “Goal (All Niches)”, but it shows up as “Goal (all Niches)”

How to get it to show as a true capitalized form?

It works, it capitalizes each word, as you dont have a space between brackets and words, it takes the left bracket as a part (first letter) of the word.

yourVariable.replace(/(^|\s+.*?)(\w)/g,(m,a,b)=>a+b.toUpperCase())

EDIT:
a nicer regex: yourVariable.replace(/\b\w/g,(m)=>m.toUpperCase())

Mmm nice catch @raelyn!

We’ll fix it so the formula is consistent with the Capitalize style option:

2 Likes