-
Handling Java’s special characters when splitting paragraph text into lines
Splitting paragraph text into lines from one layer on a second text layer on source text works fine like this:
thisComp.layer(“paragraph_text_layer”).text.sourceText.split(“\r”)[0];
The paragraph source text from layer “paragraph_text_layer” is split by “carriage return” and then referred as line [0] for line 1 and so on. All this works fine for everyday text.
But how can you handle all Java’s special characters that can randomly be contained?
Is there a quick way to replace them before splitting the text to achieve correct splitting and put them back in place afterwards?