-
expression to delete unwanted spaces at the beginning of line in a text layer
Hi, I’m trying to figure out an expression which would delete unwanted spaces at the start of a line in a text layer.
My text layer “Source Text” parameter is referencing another text layer “textLayer1” and takes the fist line from it with this expression:
txt=thisComp.layer(“textLayer1”).text.sourceText; //Looking for the text in “textLayer1”
line=txt.split(“\r”)[0];//extracting first line of text from “textLayer1”Now I’d like to delete any number of spaces before the main text starts even if they exist at the “textLayer1”. So at the end I want a text to start with any symbol but not a space.
Thanks a lot in advance for any suggestions