# IndexOf

This Expression returns a number indicating the position of the first character of a string being searched for within the databox value or 0 (zero) if no string match is found.

The syntax of the expression is as follows - parameters:

1\. string - a list of strings that should be searched for within the databox value\
2\. string - the list delimiter e.g. a comma (",") to indicate how to split the string in the first parameter\
3\. integer - 1 to indicate that the string comparison should ignore case, 0 to indicate that the string comparison should take case into consideration (i.e. when 1 "LiKeS" = "likes"

<table><thead><tr><th>Expression</th><th>Databox Value</th><th width="88">Result</th><th>Comments</th></tr></thead><tbody><tr><td><code>IndexOf("LiKeS,George", ",", 1)</code></td><td>George Smiley likes chess</td><td>14</td><td>As the case insensitive parameter is set to 1 the first string in the list of strings to search for 'LiKeS' is found at position 14.</td></tr><tr><td><code>IndexOf("LiKeS,George", ",", 0)</code></td><td>George Smiley likes chess</td><td>1</td><td>As the case insensitive parameter is set to 0 the change of case in 'LiKeS' does not match the 'likes' in the databox value, instead the second search string 'George' is matched and found at position 1.</td></tr><tr><td><code>IndexOf("NotThere", ",", 0)</code></td><td>George Smiley likes chess</td><td>0</td><td>As the string 'NotThere' cannot be found in the databox value the return value is 0.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keyfax.biz/product-suite/admin/databox-expressions/text-expressions/indexof.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
