str.pos() - Pine Script Function
str.pos()
Section titled “str.pos()”Overview
Section titled “Overview”Returns the position of the first occurrence of the str string in the source string, ‘na’ otherwise.
Syntax
Section titled “Syntax”str.pos(source, str) → const intParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| source | const string | Source string. |
Returns
Section titled “Returns”Position of the str string in the source string.
Remarks
Section titled “Remarks”- Strings indexing starts at 0.