You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Steve Cohen <sc...@javactivity.org> on 2009/12/03 17:25:09 UTC

What's the easiest way

in Velocity to convert all blank spaces to &nbsp;?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: What's the easiest way

Posted by Steve Cohen <sc...@javactivity.org>.
Nathan Bubna wrote:
> All blank spaces in what?  A template, a section of a template, or a
> string or both?  If a string, you can call all public java.lang.String
> methods, so if you use Java 5+, you can just avail yourself the
> replace methods.  If a template, it depends on how you are a storing
> that resource.  If a section of a template, you could wrap it in a
> #define block, render the block into a string and then use the
> string's replace method, as above.
> 
> 2009/12/3 Steve Cohen <sc...@javactivity.org>:
>> in Velocity to convert all blank spaces to &nbsp;?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> 
Never mind, found out I didn't need to do it anyway.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: What's the easiest way

Posted by Nathan Bubna <nb...@gmail.com>.
All blank spaces in what?  A template, a section of a template, or a
string or both?  If a string, you can call all public java.lang.String
methods, so if you use Java 5+, you can just avail yourself the
replace methods.  If a template, it depends on how you are a storing
that resource.  If a section of a template, you could wrap it in a
#define block, render the block into a string and then use the
string's replace method, as above.

2009/12/3 Steve Cohen <sc...@javactivity.org>:
> in Velocity to convert all blank spaces to &nbsp;?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org