NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

InStr Function

Returns aLong specifying the position of the first occurrence of one string within another.

InStr([start, ]string1, string2[, compare])

Arguments

start
Optional. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. The start argument is required if compare is specified.
string1
Required. String expression being searched.
string2
Required. String expression sought.
compare
Optional. Specifies the type of string comparison. If compare is omitted, the Option Compare setting determines the type of comparison. Specify a valid LCID (LocaleID) to use locale-specific rules in the comparison.

Settings

The compare argument settings are:

Constant Value Description
BinaryCompare 0 Performs a binary comparison.
TextCompare 1 Performs a textual comparison.

Return Values

If InStr returns
string1 is zero-length 0
string2 is zero-length start
string2 is not found 0
string2 is found within string1 Position at which match is found
start > string2 0

See Also

Example

InStrRev Function | Option Compare Statement | StrComp Function