#set( $backslash = '\.' )
On Feb 10, 2008 3:05 AM, Jon Seymour <[EMAIL PROTECTED]> wrote:
> I am trying to write an expression that looks takes "abc.def.ghi" in
> $package and rewrites it as abc/def/ghi, using Java 1.4 [ hence I
> can't use String.replace ].
>
> #set($path=$package.replaceAll("\.", "/"))
>
> however, this doesn't work because \. results in a lexical error
> during parsing template.
>
> Using "\\." doesn't work because "\\." is a string of 3 characters - \, \, .
>
> In the end, I had to do this:
>
> #set($tmp="\\.")
> #set($path=$package.replaceAll($tmp.substring(1,3), "/"))
>
> but this seems like a kludge.
>
> Anyone got a neater way to express the string of characters {
> backslash, period } in VTL?
>
> jon.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]