Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_StringCaseSensitiveString Functions

Public Function IndexOf (
str As String,
SubString As String,
Optional StartPosition As Long = -1 ,
Optional Length As Long = -1
) As Long

Get the 1 based index of the first occurrence of the search string in the passed string. Returns -1 if the search string is not found.

str as String

The string to search

SubString as String

The string to match

Optional StartPosition as Long = -1

The position in the string to start searching, -1 for the start of the string

Optional Length as Long = -1

The length of the section of string to search in, -1 for the whole string after StartPosition

Call Template:

Dim i As Long
i = xf.StrCS.IndexOf(str, SubString)
i = xf.StrCS.IndexOf(str, SubString, StartPosition, Length)

See Also:

Example 1:

xf.Str.IndexOf("The King's counting house is the King's", "King")   => 5
xf.Str.IndexOf("The King's counting house", "den")                  => -1
xf.Str.IndexOf("The King's counting house", "King", 10, 8)          => -1
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd