Home Cart [Log In] About Us Contact Us

Object Reference

xf_StringCaseSensitiveString Functions

Public Function FindStringInArray (
s As String,
ArrayVar As Variant,
Optional UseLikeOperator As Boolean = False
) As Long

See if the string is a member of the array.
Use the Like operator rather than equality if UseLikeOperator = true.
Returns the array index of the string or -1 if not located.

s as String

The string to find

ArrayVar as Variant

The array to search

Optional UseLikeOperator as Boolean = False

Use the Like operator to compare strings rather than =

Call Template:

Dim i As Long
i = xf.StrCS.FindStringInArray(s, ArrayVar)
i = xf.StrCS.FindStringInArray(s, ArrayVar, UseLikeOperator)

See Also:

Example 1:

dim sarr(3) as array
sarr(1) = "First"
sarr(2) = "Second"
sarr(3) = "Third"
print xf.Str.FindStringInArray("Third", sarr)       => 3
print xf.Str.FindStringInArray("Sec", sarr)         => -1
print xf.Str.FindStringInArray("Sec*", sarr, True)  => 2
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd