“How can I count the number of characters excluding whitespace in Make?”

:memo: Message:
I want to calculate the number of characters excluding all whitespace (like spaces, line breaks, tabs, etc.).

However, in the Text parser > Replace module:

  • If I leave the New value field empty, it returns null.
  • If I enter "", the result includes the quotes, so the whitespace is replaced with "" (literally, two quotation marks).

I also tried using the replace() function in an expression, but whenever I try to pass a space " " as a parameter, it becomes """ """, and the function doesn’t work as expected.

Can someone please show me a reliable way to get the number of characters excluding whitespace and line breaks in Make?

Thanks in advance!

You can’t use " " as the empty value in Make, you have to use the {{empty}} string variable

Have you solved this?

I entered {{empty}} as the value in the replace function, but it still returns null.

No, I haven’t solved it yet.

Sorry noonyyy000 it was {{emptystring}} not {{empty}}
Try this function {{length(replace("your text here"; "/\s+/g"; emptystring))}}

1 Like

Wow, it worked! Thank you so, so much!
Hope you have a wonderful day today too!

1 Like