> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for STRPOSR function

# STRPOS

Returns the position of the substring found in the string, starting from 1. The returned value is for the first matching value, and not for any subsequent valid matches.
In case the substring does not exist, functions will return 0.

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
STRPOS(<string>, <substring>)
```

## Parameters

| Parameter     | Description                       | Supported input types |
| :------------ | :-------------------------------- | :-------------------- |
| `<string>`    | The string that will be searched. | `TEXT`                |
| `<substring>` | The substring to search for.      | `TEXT`                |

## Return Type

`INTEGER`

## Example

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	STRPOS('hello world','hello') AS res;
```

**Returns**: `1`

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	STRPOS('hello world','world') AS res;
```

**Returns**: `7`

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	STRPOS('hello world','work') AS res;
```

**Returns**: `0`
