You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Søren Krogh Neigaard <So...@Systematic.com> on 2011/02/16 10:59:49 UTC

indexOf or startsWith in a velocity if statement

Hello

How can I check if a variable starts with a specific word, like in Java indexOf or startsWith? For eksample:

if($someVar.indexOf("Hello") != -1)

Med venlig hilsen / Kind regards
Søren Krogh Neigaard


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


RE: indexOf or startsWith in a velocity if statement

Posted by Søren Krogh Neigaard <So...@Systematic.com>.
Oh i can just use Java syntax... Great! Sorry for asking.

Med venlig hilsen / Kind regards

Søren Krogh Neigaard
Systems Engineer

Systematic A/S
Søren Frichs Vej 39
8000 Aarhus C
Denmark

Mobile: +4541965252
Soren.Krogh.Neigaard@Systematic.com

-----Original Message-----
From: Søren Krogh Neigaard [mailto:Soren.Krogh.Neigaard@Systematic.com] 
Sent: 16. februar 2011 11:00
To: user@velocity.apache.org
Subject: indexOf or startsWith in a velocity if statement

Hello

How can I check if a variable starts with a specific word, like in Java indexOf or startsWith? For eksample:

if($someVar.indexOf("Hello") != -1)

Med venlig hilsen / Kind regards
Søren Krogh Neigaard


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


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