I would like to write an if condition and check if a variable contains a certain string and then write some logic.
if i have a variable say @param activity
How can I check that variable activity contains the string "abc"?
I would like to write an if condition and check if a variable contains a certain string and then write some logic.
if i have a variable say @param activity
How can I check that variable activity contains the string "abc"?
On
From the documentation (https://developers.google.com/closure/templates/docs/functions_and_directives), there is the strContains method:
strContains(str, subStr) - Checks whether a string contains a particular substring.
{if strContains($activity, 'abc')}
// ...
{/if}
If you browse Closure Templates Documentation, you should be able to find what you're looking for, especially the
ifsection. Regardless, here's an example: