ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Select specified character (example:second character) in a Text

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Aimee Brown
Select specified character (example:second character) in a Text
on Sep 4, 2019 at 7:54:01 am

I would like to be able to select a specified character in a text layer.
It's just for a simple if/else expression, but I don't know how to pick out specific characters

Thanks!

if (thisComp.layer("Text 1").text.sourceText(index-1) == "e")
100
else
0


Return to posts index

Andrei Popa
Re: Select specified character (example:second character) in a Text
on Sep 4, 2019 at 11:04:35 am

myIndex = 3;
if (thisComp.layer("Text 1").text.sourceText.split("")[myIndex-1] == "e")
100
else
0

Andrei
My Envato portfolio.


Return to posts index

Aimee Brown
Re: Select specified character (example:second character) in a Text
on Sep 4, 2019 at 11:10:58 am

Thanks.
I couldn't find my post after I posted it, and I found a different solution. This is more what I was looking for (in case anyone else has the same query).

if (thisComp.layer("Text 1").text.sourceText[1] == "e")
100
else
0


Return to posts index

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