> For the complete documentation index, see [llms.txt](https://muradkarakas.gitbook.io/sodium_documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://muradkarakas.gitbook.io/sodium_documentation/language-reference/built-in-functions/built-in-string-functions-and-operands/instr.md).

# instr

`instr` has 1 variant:

{% tabs %}
{% tab title="Variant 1" %}

#### Description <a href="#description" id="description"></a>

`instr` function returns the location of a substring in a string. If substring is not found in string, then the `instr` function will return 0.

#### Declaration <a href="#declaration" id="declaration"></a>

```
int instr(char string, char substring);
```

#### Parameters <a href="#parameters" id="parameters"></a>

1. `char string`
2. `char substring`

#### Return Value <a href="#return-value" id="return-value"></a>

#### Example <a href="#example" id="example"></a>

```
int pos;pos = instr("Tech on the net", "e");
```

Result: 2 (the first occurrence of 'e'

#### See also <a href="#see-also" id="see-also"></a>

{% endtab %}
{% endtabs %}
