You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Sankaranarayanan K <sa...@amritatech.com> on 2007/09/26 09:51:24 UTC

replace method

Hi,

I am using velocity framework in my project, it is java based.
I would like know about any  replace method (like java replace method )
Since I want to replace $values instated of the dynamic variable  inside
my .vm files


Thanks & Regards,
Sankaranarayanan


Software Engineer,
Amrita Technologies,
Cochin.
PH :(Office) 91-0484-4008945 (Ext -8977).

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


Re: replace method

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Sankaranarayanan,

This question would be better asked on the user list, not the dev list.
You should post to user@velocity.apache.org next time.

Sankaranarayanan K wrote:
> I would like know about any  replace method (like java replace method )
> Since I want to replace $values instated of the dynamic variable  inside
> my .vm files

I'm not sure if I understand your question.

Do you want to call java.lang.String.replace on a String object you
already have in a variable called $values?

If so, you can just call it:

#set($values = "This is a String")
$values.replace("is", "was")

This will print:

This was a String

Does that answer your question?

-chris