OK, I managed to solve my problem by changing the replacement string:
replaceAll("\n", "$0 * ")
So the issue has changed a bit -- what am I missing in the docs about string
processing?
When executed from a java program, replaceAll("\n", "\n * ") does what I
want, but when I put this same syntax into a velocity template, the
replacement ends up as "n * " where the newlines were replaced with the
letter n followed by my " * " sequence.
From this I conclude that velocity processing of the string literal is
having some side effect that I'm not aware of.
What am I missing about string processing?
Michael
On 3/5/07, Michael Giroux <[EMAIL PROTECTED]> wrote:
My template is generating javadocs. The input string may have \n
characters that I wish to convert to "\n * " to preserve the intent of the
comment string.
In java, I am able to accomplish this with "xxx\nyyy".replaceAll("\n", "\n
* ")
I have tried a couple of variations in the velocity template, but so far,
the replaceAll is not replacing the strings.
A hex dump of the output file shows that the result of the generation is
xxx\nyyy (\n == 0x0a).
What am I doing wrong?
Thanks
Michael Giroux