String Operators
Last updated
Was this helpful?
{{$startsWith string1 string2}}
Evaluates to true if string1 starts with string2.
Arguments
string1
A static value or a variable path to check for string2
string2
A static value or a variable path to check for in string1
Returns
(Boolean)
Example
{{#if ($startsWith movie "Bourne") }}Movie starts with Bourne{{/if}}
{
"movie":"Bourne Identity"
}Movie starts with Bourne
{{$endsWith string1 string2}}
Evaluates to true if string1 ends with string2.
Arguments
string1
A static value or a variable path to check for string2
string2
A static value or a variable path to check for in string1
Returns
(Boolean)
Example
{{#if ($endsWith movie "Story") }}Movie ends with Story{{/if}}
Movie ends with Story
{{$contains string1 string2}}
Evaluates to true if string1 exists in string2.
Arguments
string1
A static value or a variable path to check for string2
string2
A static value or a variable path to check for in string1
Returns
(Boolean)
Example
{{#if ($contains movie "Bronx") }}Movie contains Bronx{{/if}}
Movie contains Bronx
{{$doesNotContain string1 string2}}
Evaluates to true if string1 does not exist in string2.
Arguments
string1
A static value or a variable path to check for string2
string2
A static value or a variable path to check for in string1
Returns
(Boolean)
Example
{{#if ($doesNotContian movie "Batman") }}Movie does not contain Batman{{/if}}
Movie does not contain Batman
{{$matches string expression}}
Returns true if string matches a regular expression.
Arguments
string
A static value or a variable path to evaluate the regular expression against
expression
Regular expression to evaluate
Returns
(Boolean)
Example
{{#if ($matches category "^spo.*") }}Category matches regular expression{{/if}}
Category matches regular expression
Last updated
Was this helpful?
Was this helpful?
{
"movie":"Toy Story"
}{
"movie":"A Bronx Tale"
}{
"movie":"The Dark Knight"
}{
"category":"sports"
}