myText = thisComp.layer("textLayer").text.sourceText;
myTextWithoutSpaces = myText.replace(/\s/g, ""); // Remove all spaces
myTextWithoutSpaces.length;
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:
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.