Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to know the number of characters per lines?

  • How to know the number of characters per lines?

    Posted by Martin Jean-sébastien on July 2, 2015 at 8:32 am

    Hello,
    Is it possible to know how much characters there are per lines in a text?
    I can know the number of lines with this :
    “nb of lines = “+thisComp.layer(“TextBase”).text.sourceText.value.split(/\n|\r/).length

    I can know the number of words with this :
    “nb of words = “+thisComp.layer(“TextBase”).text.sourceText.length

    But how to know the number of characters per lines???

    Thank you!

    Dan Ebberts replied 10 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    July 2, 2015 at 1:59 pm

    You can get the number of characters in a particular line like this:

    lines = thisComp.layer(“TextBase”).text.sourceText.value.split(“\r”);
    lines[0].length

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy