LOTUSSCRIPT LANGUAGE


InStr function
Example

Returns the position of the character that begins the first occurrence of one string within another string.

Syntax

InStr ( [ begin , ] string1 , string2 )

or

InStr ( [ begin , ] string1 , string2 [, compMethod ] )

Elements

begin


string1
string2
compMethod
Return value

InStr returns the character position of the first occurrence of string2 within string1. The following table shows how the function responds to various conditions.
ConditionReturn value
string1 is the empty string ("")0
string2 is not found after begin in string10
begin is larger than the length of string10
string2 is the empty string ("")The value of begin. If you omit begin, InStr returns the value 1.
string1 is NULLNULL
string2 is NULLNULL
begin or compMethod is NULLError

Usage

If you want to work with bytes, use the InStrB function.

Language cross-reference

@Middle function in formula language

Example
See Also