Skip to content
Algo Trade Analytics Docs

str.pos() - Pine Script Function

Returns the position of the first occurrence of the str string in the source string, ‘na’ otherwise.

str.pos(source, str) → const int
NameTypeDescription
sourceconst stringSource string.

Position of the str string in the source string.

  • Strings indexing starts at 0.