Finds the location of a substring in a string. The substring can contain wildcard characters.
SEARCH(pattern, str)
SEARCH(pattern, str, startPosition)
The string pattern to search for. You must enclose the pattern in double quotation marks (" "). You can use the following special characters in a pattern:
The string in which to search.
The position in str where the search starts.
The numerical position of the string pattern in the string. The first character of a string starts at 1. If the substring is not found, SEARCH( ) returns 0.
The following example searches for the string pattern, S*A, in each product code. If the product name is KBS5412A, SEARCH( ) returns 3.
SEARCH("S*A", [ProductCode])
The following example uses SEARCH( ) in conjunction with the LEFT( ) function to display the characters that precede the first space character in a product name. 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 space character.
LEFT([ProductName], SEARCH(" ", [ProductName]))
If the product name is 1969 Ford Falcon, the expression returns 1969.

Additional Links:

© Copyright OpenText Corp. All rights reserved. Privacy Policy | Cookie Policy

BIRT iHub 2