Removing blank lines in report fields
Posted on November 25, 2013 at 3:12am
Hi,
I am trying to format a multi-line text field in a report to remove blank lines. After a bit of reading I have come up with the following regular expressions but the editor won't accept them and it throws a syntax error. Am I even close!?
$F{followups}.replace("/^\s*\n/gm", "")
or
$F{followups}.replace(/(\r\n|\n|\r)/gm,"")
Joined: Apr 1 2009 - 2:04am
Last seen: 9 years 10 months ago
Posted on November 27, 2013 at 1:57am
After a bit more research and trial and error I found that the root cause of the problem was that the slashes needed double quoting ('\')
Also, I ended up using a different syntax:
$F{followups}.replaceAll("(?m)^[ \\t]*\\r?\\n", "")
Joined: Apr 1 2009 - 2:04am
Last seen: 9 years 10 months ago