Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Are there text functions, like left(“hello”,3)?

  • Are there text functions, like left(“hello”,3)?

    Posted by Paul Roper on October 16, 2012 at 1:17 pm

    I’m looking to use an expression to extract the leftmost and rightmost chunks from another text layer, but can’t find anything helpful – searching for “after effects expression text left right” just brings up thousands of results that mention right-clicking and such.

    So, is there a simple way to do this that anyone knows of? Something along the lines of:

    a=”hello world”;
    left(a,4)

    gives “hell”
    ??

    Dan Ebberts replied 13 years, 10 months ago 3 Members · 2 Replies
  • 2 Replies
  • Paul kenneth Egell-johnsen

    October 16, 2012 at 2:30 pm

    You can use the animators for text objects to select stuff by index and by character. Check out the presets for text animation for more ideas.

  • Dan Ebberts

    October 16, 2012 at 3:05 pm

    You can use the JavaScript string methods. In your example, a.substr(0,5) would give you “hello”, a.substr(-5) would give you “world”.

    Dan

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