---
schema_version: "1"
id: 3da39ce7a8774594e4e77739215d02e226f2ab18af786ad6dbf317c63b93414d
title: STRPOS
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/string-func/strpos.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/strpos.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4b844bc88eea2dc0d337c1280305edefde6389217c55ed37f4f38caaae07aa4d
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `STRPOS`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the location of a substring within a string.

## Syntax

```sql
strpos(<string>, <substring>)
```

## Arguments

### Required

- `<string>`: The string to search.
- `<substring>`: The substring to find.

## Returns

Returns an integer representing the 1-based position, or `0` if not found.

## Considerations

- Same as `position(substring in string)` but with reversed argument order.

## Examples

### Find Substring

Locate a substring within a string.

```sql
SELECT strpos('high', 'ig') AS result;
```

Returns `2`.

## Related Documentation

- [String Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/string.md)
