How to replace all instances of a set of characters (including line breaks) in the source text?
Another question ragarding .replace: I want to remove the line breaks before and after all "'*" characters in a layer source text:
"Text 1
*
Text 2
*
Text 3"
should turn into "Text 1*Text 2*Text 3". I've recently learned that .replace only affects the first instance, and needs to be complemented by a /g (as in "global"). However, I can't find out exactly how to make this work. This is my best attempt:
text.sourceText.replace(/\r*\r/g, "*")
but it doesn't work. What am I doing wrong here?
