Print      Open PDF Version of Online Help


Previous Topic

Next Topic

InStr

The InStr function in Expression Builder returns the position of the first occurrence of one string within another.

Syntax

Instr(string1, string2, start, end)

Result Type

Integer

Arguments

The following table describes the arguments for the function.

Argument

Description

string1

Specifies the string that is to be searched. The value can be a string literal, or a field name, or an expression that returns a string.

string2

Specifies the string that is to be searched for. The value can be a string literal, or a field name, or an expression that returns a string.

NOTE: The search for a string is case-sensitive.

start

(Optional) An integer that specifies the start point in string1.

end

(Optional) An integer that specifies the end point in string1.

NOTE: The language-independent field names and the field-name syntax used in any example expressions in this topic are the field names and the field-name syntax that were used in Expression Builder in releases earlier than Release 29 Service Pack 1. These examples are still valid. However, if you select the corresponding fields for an expression from the Fields list in Expression Builder in Release 29 Service Pack 1 or later, then the field names and the field-name syntax will be different from those shown in the examples. It is recommended that you always select the fields for your expressions from the Fields list in Expression Builder, so that the field names and the field-name syntax are always correct. For more information about the field names and the field-name syntax in expressions, see About Expressions.

Examples

The following example returns the value 9:

InStr('john.doe@company.com','@')

The following example shows how the InStr function can be used in a workflow rule condition. In the workflow rule condition, the InStr function is used to determine if a specified string appears in a field on the record. If the string is found in the field, then the actions specified on the workflow rule are performed. In this example, the InStr function determines if the Subject field in a record contains the word REVIEW. The action on the workflow rule is performed only if the Subject field contains the word REVIEW in uppercase letters.

InStr([<Subject>], 'REVIEW') > 0

Related Topics

See the following topics for related Expression Builder information:


Published 7/3/2018 Copyright © 2005, 2018, Oracle. All rights reserved. Legal Notices.