# FindOneOf - script and chart function

FindOneOf() searches a string to find the position of the occurrence of any character from a set of provided characters. The position of the first occurrence of any character from the search set is returned unless a third argument (with a value greater than 1) is supplied. If no match is found, 0 is returned.

Syntax:

FindOneOf(text, char\_set[, count])

Return data type: integer

Arguments:

Arguments

| Argument | Description |
| --- | --- |
| text | The original string. |
| char\_set | A set of characters to search for in text. |
| count | Defines which occurrence of any of the characters to search for. For example, a value of 2 searches for the second occurrence. |

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/FindOneOf.htm)

#### Example: Chart expressions

| Example | Result |
| --- | --- |
| `FindOneOf(<br>'my example text string', 'et%s')` | Returns '4' because ‘e’ is the fourth character in the example string. |
| `FindOneOf(<br>'my example text string', 'et%s', 3)` | Returns '12' because the search is for any of the characters e, t, % or s, and "t" is the third occurrence in position 12 of the example string. |
| `FindOneOf(<br>'my example text string', '¤%&')` | Returns '0' because none of the characters ¤, %, or & exist in the example string. |

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/FindOneOf.htm)

#### Load script and results

```
Load *
Inline
[SearchFor, Occurrence
et%s,1
et%s,3
¤%&,1]
```

Result

| SearchFor | Occurrence | FindOneOf('my example text string', SearchFor, Occurrence) |
| --- | --- | --- |
| et%s | 1 | 4 |
| et%s | 3 | 12 |
| ¤%& | 1 | 0 |