You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

index_of()

Usage

index_of(string, word)

or

Structr.indexOf(string, word)

in JavaScript context

Description
Returns the position of the first occurrence of the given word in the given string, or -1 if the string doesn’t contain the word.

Example

${index_of('This is a test', 'test')}

results in

10

Search results for "index_of()"

index_of()

Returns the position of the first occurrence of the given word in the given string, or -1 if the string doesn’t contain the word.

index_of(string, word)