FIND( )
Finds the location of a substring in a string.
Syntax
FIND(strToFind, str)
FIND(strToFind, str, startPosition)
Arguments
strToFind
The substring to search for. The search is case-sensitive.
str
The string in which to search.
startPosition
The position in str where the search starts.
Returns
The numerical position of the substring in the string. The first character of a string starts at 1. If the substring is not found, FIND( ) returns 0.
Example
The following example searches for the substring, Ford, in each ProductName value:
FIND("Ford", [ProductName])
If the product name is 1969 Ford Falcon, FIND( ) returns 6.
The following example searches for the first hyphen (-) in each product code:
FIND("-", [ProductCode])
If the product code is ModelA-1234-567, FIND( ) returns 7.
The following example uses FIND( ) in conjunction with the LEFT( ) function to display the characters that precede the hyphen in a product code. The LEFT( ) function extracts a substring of a specified length, starting from the first character. In this example, the length of the substring to display is equal to the numerical position of the hyphen character.
LEFT([ProductCode], FIND("-", [ProductCode]))
If the product code is ModelA-1234, LEFT( ) returns the following string:
ModelA

Additional Links:

Copyright Actuate Corporation 2013 BIRT iHub 2