Wrong expression for splitting layertext into multiple lines
Hi,
How can I combine the two expressions below into one? So whenever I write "_" in the text layers name, the text splits into a new line and when I don't enter "_" it just shows the layers name?
Expression 1 (splits my layer in new lines)
a = thisLayer.name.split("_")[0].replace("_", "\n");
b = thisLayer.name.split("_")[1].replace(" ", "\n");
c = thisLayer.name.split("_")[2].replace(" ", "\n");
a+" "+b+" "+c
Expression 2 (for the layers that only have one line)
thisLayer.name.split("_");
Problem
When I don't enter "_" in expression 1 it gives me an error message + it forces me to change the expression every time I want more/fewer lines than 3.
Thanks

