Get string match from variable

Hi there,

does anyone know how to look for part of a variable string in velocity? I want to see if a variable i have created has a certain word in it.

Thanks in advance.

You should be able to use any of the Java String methods (http://docs.oracle.com/javase/6/docs/api/java/lang/String.html).

Something like:

#if($myPathVar.contains("SubSectionName"))
  <h2>In MySubSection</h2>
#end

[QUOTE=lisaw;20788]Hi there,

does anyone know how to look for part of a variable string in velocity? I want to see if a variable i have created has a certain word in it.

Thanks in advance.[/QUOTE]