# FindOneOf

Finds the first occurrence of any character in a set of characters, from a specified start position.

## Method Signature

```
FindOneOf(set=[string], string=[string], start=[integer])
```

### Arguments

| Argument | Type      | Required | Description                                                             | Default |
| -------- | --------- | -------- | ----------------------------------------------------------------------- | ------- |
| `set`    | `string`  | `true`   | The set of characters to search for the first occurrence of.            |         |
| `string` | `string`  | `true`   | The string to search in.                                                |         |
| `start`  | `integer` | `false`  | The position from which to start searching in the string. Default is 1. | `1`     |

## Examples

### Find first instance starting from beginning of string.

We're not passing a start index in this example.

[Run Example](https://try.boxlang.io/?code=eJxdjTEKgDAQBHtfsaRSED8gviGF9hI00YN4htyJ%2BHtjK2wxOyysaCbeZj1n8S4vOwaYaffIjhglY%2FoguBgFR8H4fFbLIsVSpTN9dWdSby9Nl9YIxKtlb0MNQ2xayP%2BhQdNXLxoZKWs%3D)

```java
string_to_search = "The rain in Spain falls mainly in the plains.";
writeOutput( findOneOf( "in", string_to_search ) );

```

Result: 7

### Find first instance starting from the twelfth character.

Let's pass in a starting index of 12. The search will start at the twelfth character, just before the word 'Spain'.

[Run Example](https://try.boxlang.io/?code=eJwrLinKzEuPL8mPL05NLErOULBVUArJSFUoSszMUwCi4AIQIy0xJ6dYIRfIzKkEiZYAVRTkALnFekrWXOVFmSWp%2FqUlBaUlGgppmXkp%2Fnmp%2FmkaCkqZeUo6CsVoNugoGBopaCpoWnMBAMInKho%3D)

```java
string_to_search = "The rain in Spain falls mainly in the plains.";
writeOutput( findOneOf( "in", string_to_search, 12 ) );

```

Result: 16

### Example showing this function will search all characters from the 'set' argument in the 'string' argument.

This function is case-sensitive so 't' does NOT match the first 'T'. It's the same for 'H' NOT matching the first 'h'. But 'e' matches the 'e' at the third position. Since this is the first match, this is the index that is returned.

[Run Example](https://try.boxlang.io/?code=eJxdjbEKgDAQQ3e%2FInRSEMFZ3N066C5Fr1qotfROxL%2B3rkKGl0cgLMmFbZZzZjJp2dFDTTshGReQM8YPrPGecWT0z2clL6LPlRvVFXdyQvqSeEkJ68KqA2lbQslAqgb%2FLmq0qFB1xQvBgioy)

```java
string_to_search = "The rain in Spain falls mainly in the plains.";
writeOutput( findOneOf( "tHe", string_to_search, 1 ) );

```

Result: 3

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxLKc0t0FBwy8xL8c9L9U%2FTUFBKVNIBEgoQmASBSgqaCprWXCkYipNIUZyMWzEApfYixg%3D%3D)

```java
dump( FindOneOf( "a", "a a a a b b b b" ) );
dump( FindOneOf( "b", "a a a a b b b b" ) );
dump( FindOneOf( "c", "a a a a b b b b" ) );

```

## Related

* [Ascii](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/ascii)
* [CamelCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/camelcase)
* [Char](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/char)
* [CharsetDecode](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/charsetdecode)
* [CharsetEncode](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/charsetencode)
* [Compare](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/compare)
* [CompareNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/comparenocase)
* [Find](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/find)
* [FindNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/findnocase)
* [Insert](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/insert)
* [JSStringFormat](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/jsstringformat)
* [Justify](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/justify)
* [KebabCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/kebabcase)
* [LCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/lcase)
* [Left](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/left)
* [ListReduce](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/listreduce)
* [LJustify](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/ljustify)
* [LTrim](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/ltrim)
* [Mid](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/mid)
* [ParagraphFormat](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/paragraphformat)
* [PascalCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/pascalcase)
* [QueryStringToStruct](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/querystringtostruct)
* [ReEscape](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/reescape)
* [ReFind](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/refind)
* [reFindNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/refindnocase)
* [ReMatch](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/rematch)
* [reMatchNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/rematchnocase)
* [RemoveChars](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/removechars)
* [RepeatString](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/repeatstring)
* [Replace](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/replace)
* [ReplaceList](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/replacelist)
* [ReplaceListNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/replacelistnocase)
* [ReplaceNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/replacenocase)
* [ReReplace](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/rereplace)
* [reReplaceNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/rereplacenocase)
* [Reverse](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/reverse)
* [Right](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/right)
* [RJustify](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/rjustify)
* [RTrim](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/rtrim)
* [Slugify](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/slugify)
* [SnakeCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/snakecase)
* [SpanExcluding](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/spanexcluding)
* [SpanIncluding](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/spanincluding)
* [SQLPrettify](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/sqlprettify)
* [StringBind](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringbind)
* [StringEach](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringeach)
* [StringEvery](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringevery)
* [StringFilter](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringfilter)
* [StringMap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringmap)
* [StringReduce](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringreduce)
* [StringReduceRight](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringreduceright)
* [StringSome](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringsome)
* [StringSort](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stringsort)
* [StripCR](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/stripcr)
* [Trim](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/trim)
* [TrueFalseFormat](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/truefalseformat)
* [UCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/ucase)
* [UCFirst](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/ucfirst)
* [Val](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/val)
* [Wrap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/wrap)
* [YesNoFormat](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/yesnoformat)


---

# 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://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/string/findoneof.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.
