For the complete documentation index, see llms.txt. This page is also available as Markdown.

String Operators

startsWith

{{$startsWith string1 string2}}

Evaluates to true if string1 starts with string2.

Arguments

Name
Description
Type
Required

string1

A static value or a variable path to check for string2

String

string2

A static value or a variable path to check for in string1

String

Returns

(Boolean)

Example

{{#if ($startsWith movie "Bourne") }}Movie starts with Bourne{{/if}}

endsWith

{{$endsWith string1 string2}}

Evaluates to true if string1 ends with string2.

Arguments

Name
Description
Type
Required

string1

A static value or a variable path to check for string2

String

string2

A static value or a variable path to check for in string1

String

Returns

(Boolean)

Example

{{#if ($endsWith movie "Story") }}Movie ends with Story{{/if}}

contains

{{$contains string1 string2}}

Evaluates to true if string1 exists in string2.

Arguments

Name
Description
Type
Required

string1

A static value or a variable path to check for string2

String

string2

A static value or a variable path to check for in string1

String

Returns

(Boolean)

Example

{{#if ($contains movie "Bronx") }}Movie contains Bronx{{/if}}

doesNotContain

{{$doesNotContain string1 string2}}

Evaluates to true if string1 does not exist in string2.

Arguments

Name
Description
Type
Required

string1

A static value or a variable path to check for string2

String

string2

A static value or a variable path to check for in string1

String

Returns

(Boolean)

Example

{{#if ($doesNotContian movie "Batman") }}Movie does not contain Batman{{/if}}

matches

{{$matches string expression}}

Returns true if string matches a regular expression.

Arguments

Name
Description
Type
Required

string

A static value or a variable path to evaluate the regular expression against

String

expression

Regular expression to evaluate

String

Returns

(Boolean)

Example

{{#if ($matches category "^spo.*") }}Category matches regular expression{{/if}}

Last updated

Was this helpful?