velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@alaska.net>
Subject Re: Escaping single quote or double quote (' or '')
Date Mon, 19 Jan 2004 16:17:41 GMT
Kok Hoor <kokhoor@solutionx.com.my> wrote:
> Hi all,
> 
>     I am quite new to velocity, and I think what I am asking here is not
> in
> The documents.
> 
>     Is it possible to escape a single quote (') inside a single quoted
> Expression, like this:
> 
> 	'test\''
> 
>     Or 
> 
> 	"test\""
> 

I've used the following:

#set( $dollarSign = '$' )
#set( $poundSign = '#' )
#set( $doubleQuote = '"' )

I would imagine that you can also do the following although I've never 
tested it.

#set( $singleQuote = "'" )

In your example, it'd come out as

"test${singleQuote}"

or 

"test${doubleQuote}"


There is no \ notation for velocity (although the docs incorrectly stated 
that there was such a thing at one point).


-Mike

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


Mime
View raw message