Try with:
#if($foo.indexOf("moo foo") >= 0)
Claude
Le samedi 03 février 2007 à 08:30 -0700, tech1 a écrit :
>
> I'd like to use a conditional statement that tests content for keywords.
> I've only been able to find gt, lt or == as conditionals in any of the user
> guides......
>
> For example:
>
> #set( $bar = ["foo", "moo foo", "bar moo foo", "bar foo moo", "foo moo
> foo"] )
>
> #foreach ( $foo in $bar )
>
> #if ( $foo contains "moo foo")
>
> #do some stuff
>
> #end
>
> #end
>
>
> Which will do stuff with "moo foo" "bar moo foo" and "foo moo foo" ;
> and ignore "foo" and "bar foo moo".
>
> Is there any way to search contents using an if statement in Velocity?
>
>
>
>
> ---------------------------------------------------------------------
> 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]