Browse the docs

characters

Counts the characters in some text.

Keyboard Maestro: CHARACTERS

Details #

characters(text) takes exactly one argument and returns how many characters it holds. A number, true/false or list is turned into text first (see string), and nothing counts as 0.

It counts what you see as characters, so an accented letter or an emoji counts once. Spaces and line breaks count too.

Parameters #

Takes 1 argument. {{ characters(text) }}

Examples #

characters("hello world")
→ 11
characters(text)
→ 11
Sample variableValue
textSwitchboard

Gotchas #

  • Calling it with no argument or two arguments is an error: characters() takes 1 argument, got 2.

  • For anything but plain text, length is similar but counts the items of a list or record instead of its text.