STRPOS

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the location of a substring within a string.

Syntax 

1strpos(<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.

1SELECT strpos('high', 'ig') AS result;

Returns 2.

Related Documentation 

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!