You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Gary Catlin <gc...@gmail.com> on 2011/01/08 00:09:16 UTC

Adding newline to a string

Hello all.

I am looking to insert a newline char into a string that will be interpreted
by MS Word as a newline. I tried the EscapeTool, but the $(esc.n) was
ignored when the string was ported to Word. I know that Word differentiates
between a newline and a paragraph. It would be nice to know the codes for
both. Thanks.

Re: Adding newline to a string

Posted by Gary Catlin <gc...@gmail.com>.
But this worked! Simply put a return inline.

#set ($result = "${result}
${ResRec}")

Found it here:

http://ansaurus.com/question/3667808-new-line-in-velocity-set-directive

On Fri, Jan 7, 2011 at 6:53 PM, Gary Catlin <gc...@gmail.com> wrote:

> No, I tried those earlier. No success. Thanks anyway.
>
>
> On Fri, Jan 7, 2011 at 6:26 PM, jian chen <ch...@gmail.com> wrote:
>
>> I wonder if you just need to do \r\n?
>>
>> Jian
>>
>> On Fri, Jan 7, 2011 at 3:09 PM, Gary Catlin <gc...@gmail.com> wrote:
>>
>> > Hello all.
>> >
>> > I am looking to insert a newline char into a string that will be
>> > interpreted
>> > by MS Word as a newline. I tried the EscapeTool, but the $(esc.n) was
>> > ignored when the string was ported to Word. I know that Word
>> differentiates
>> > between a newline and a paragraph. It would be nice to know the codes
>> for
>> > both. Thanks.
>> >
>>
>
>

Re: Adding newline to a string

Posted by Gary Catlin <gc...@gmail.com>.
No, I tried those earlier. No success. Thanks anyway.

On Fri, Jan 7, 2011 at 6:26 PM, jian chen <ch...@gmail.com> wrote:

> I wonder if you just need to do \r\n?
>
> Jian
>
> On Fri, Jan 7, 2011 at 3:09 PM, Gary Catlin <gc...@gmail.com> wrote:
>
> > Hello all.
> >
> > I am looking to insert a newline char into a string that will be
> > interpreted
> > by MS Word as a newline. I tried the EscapeTool, but the $(esc.n) was
> > ignored when the string was ported to Word. I know that Word
> differentiates
> > between a newline and a paragraph. It would be nice to know the codes for
> > both. Thanks.
> >
>

Re: Adding newline to a string

Posted by jian chen <ch...@gmail.com>.
I wonder if you just need to do \r\n?

Jian

On Fri, Jan 7, 2011 at 3:09 PM, Gary Catlin <gc...@gmail.com> wrote:

> Hello all.
>
> I am looking to insert a newline char into a string that will be
> interpreted
> by MS Word as a newline. I tried the EscapeTool, but the $(esc.n) was
> ignored when the string was ported to Word. I know that Word differentiates
> between a newline and a paragraph. It would be nice to know the codes for
> both. Thanks.
>