STD.Str.Find( source, target, instance )
STD.Uni.Find( source, target, instance )
STD.Uni.LocaleFind( source, target, instance, locale )
source | A string containing the data to search. |
target | A string containing the substring to search for. |
instance | An integer specifying which occurrence of the target to find. |
locale | A null-terminated string containing the language and country code to use to determine correct sort order and other operations. |
Return: | Find returns an INTEGER value. |
The Find functions return the beginning index position within the source string of the specified instance of the target string. If the target is not found or the specified instance is greater than the number of occurrences of the target in the source, Find returns zero (0). Trailing spaces are considered to be significant when comparing.
Example:
A := IF(STD.Str.Find('ABCDE', 'BC',1) = 2, 'Success', 'Failure - 1'); //success B := IF(STD.Str.Find('ABCDEABCDE', 'BC', 2) = 7, 'Success', 'Failure - 2'); //success C := IF(STD.Str.Find('ABCDEABCDE', '') = 0, 'Success', 'Failure - 3'); //syntax error, missing 3rd parameter D := IF(STD.Str.Find('', 'BD', 1) = 0, 'Success', 'Failure - 4'); //success
See Also: Contains