---
title: "INDEXOF"
url: "https://help.formsfly.com/en/article/indexof"
language: "en"
last_updated: "2024-10-29T10:23:58.322Z"
---

# INDEXOF

Gets the zero-based position for the first occurrence of the given value in the input text.

### Syntax

`INDEXOF(input, value, optionalStartIndex, optionalCount)`

### Examples

```plaintext
indexof('AAA|BBB|CCC', 'A') returns 0
indexof('AAA|BBB|CCC', 'BD') is -1
indexof('AAA|BBB|CCC', 'B', 5) is 5
indexof('AAA|BBB|CCC', '|', 4, 3) is 7
```

### Notes

Returns -1 if the search value is not found.  
Optional start index will begin search at given zero-based index.  
Optional count specifies how many characters to search within from the start index.
