View all expressions
Interpolation

Character Counter for Text Layers Excluding Spaces

Counts the number of characters in a text layer while excluding spaces, providing a more precise character count for text that may include whitespace.

Contributed by:


myText = thisComp.layer("textLayer").text.sourceText;
myTextWithoutSpaces = myText.replace(/\s/g, ""); // Remove all spaces
myTextWithoutSpaces.length;

Character Counter for Text Layers Excluding Spaces

Practical use case

Perfect for templates and animations where the number of characters, excluding spaces, plays a role in dynamic layouts, adjusting design elements, or enforcing text length limits.

Check out similar expressions

Data-driven video workflows for After Effects are easier with Plainly.

a mesh of elegant lines transparent image