Finding the Index of the Last Occurrence of a Word in a String
Reported for version 10
What expression may be used for finding the last occurrence of a word within a string?
For the purpose of finding the last occurrence of a word within a string, use the expression lastIndexOf. The definition of the expression is following:
integer lastIndexOf(string srcStr, string subStr [, integer fromIndex=0])
The expression returns the index within the string srcStr of the last (rightmost) occurrence of the substring subStr, starting at the index fromIndex. If the substring is not found, the null value is returned. If the value fromIndex exceeds the length of string srcStr, the null value is returned as well. If the value fromIndex is less than zero, the start of search is counted relative to the end of the string. However, if the counted start overlaps the string start, then the search starts at the beginning of the string srcStr. The index of the first character is zero.
You can find more information about expressions which can be used in DQC in the built-in Help by pressing an F1 button on your keyboard. All the expressions are described there.