ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Write Text from Character X to Character Y

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Christopher Bly
Write Text from Character X to Character Y
on Mar 14, 2018 at 5:41:21 pm

I'm fairly sure there's a pretty simple expression for this, but I can't remember it and hopefully someone can jog my memory. I'm looking for an expression that only writes part of a string of text, from character X to character Y.
Example: If I have a text layer with the source text "Expression", but I only want it to write starting at the 3rd character and ending at the 9th, so it would come out "pressi".
Anyone have an idea of how this is done?


Return to posts index

Dan Ebberts
Re: Write Text from Character X to Character Y
on Mar 14, 2018 at 5:53:18 pm

Either of these should work:

value.substr(2,6) // first character, how many

value.substring(2,8) // first character, last character


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]