Created
September 5, 2018 00:01
-
-
Save animoplex/40663fc6584e80f4de3c734dcd5c749f to your computer and use it in GitHub Desktop.
Substring Examples - After Effects Expression by Animoplex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Substring Expressions - Created by Animoplex: www.animoplex.com | |
// Some advanced examples of substrings and text formatting combinations. | |
// Full Tutorial: https://www.youtube.com/watch?v=oz352OsNgnI | |
// Substring Examples | |
name.substr(0, 2) // Output everything between 0 and 2 | |
name.substr(2, name.length) // Output everything between 2 and the last character | |
name.substr(name.length - 1, 1) // Output the last character | |
// Bonus Substring Example | |
// Outputs "Comp Name: MainComp" and "Revision Number: 06", assuming the comp name's format is "MainComp06" | |
src = thisComp.name; | |
myName = src.substr(0, src.length - 2); | |
myVersion = src.substr(src.length - 2, 2); | |
"Comp Name: " + myName + "\r" + "Revision Number: " + myVersion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment