StrPos

Category: Strings

Back to System Functions


Signature

StrPos(text As String, searchFor As String)
StrPos(text As String, searchFor As String, caseSensitive As Boolean)

Returns

Integer

Description

Searches for the first occurrence of searchFor within text.

The returned position is zero-based. Returns -1 when no match is found.

The optional caseSensitive parameter defaults to False.

Example

index = StrPos("LunarBasic", "basic") strictIndex = StrPos("LunarBasic", "basic", True)