tags:

views:

360

answers:

3

I would like to know how can i escape a # in velocity. Backslash seems to escape it but it prints itself as well

This:

\#\#

prints:

\#\#

I would like:

##
+2  A: 

Maybe, the following site helps? http://velocity.apache.org/tools/releases/1.4/generic/EscapeTool.html

Thomas
+1  A: 

Add the esc tool to your toolbox and then you can use ${esc.hash}

Sergio del Amo
+1  A: 

If you don't want to bother with the EscapeTool, you can do this:

set( $H = '#' )

$H$H

Nathan Bubna