ChrPos

Category: Strings

Back to System Functions


Signature

ChrPos(text As String, character As String)
ChrPos(text As String, character As String, caseSensitive As Boolean)

Returns

Integer

Description

Searches for the first occurrence of a character in text.

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

The optional caseSensitive parameter defaults to False.

If character contains multiple characters, only the first character is used for matching.

Example

index = ChrPos("LunarBasic", "b") strictIndex = ChrPos("LunarBasic", "b", True)