Use: | Locates the first occurrence of a substring in a string, starting at a specified position from the beginning of the string. |
Syntax: | {FIND( «string» , «string», «num»)}
|
Arguments: |
First «string»
Character string to be searched
Second «string»
String value to be found
«num»
Zero-based character position in first string from where to begin the search
|
Returns: | The zero-based character position of the first character of the substring, if found -Or- -1 if the substring is not found |
Example 1: |
Fields = txt_field1, txt_field2
{template_name_.txt_field1} = NextGen Healthcare
{template_name_.txt_field2} = care
{FIND( {template_name_.txt_field1}, {template_name_.txt_field2}, 0)}
-Or-
{FIND( {template_name_.txt_field1}, care, 0)}
Result: 14 |
Example 2: |
Fields = txt_field1, txt_field2
{template_name_.txt_field1} = NextGen Healthcare
{template_name_.txt_field2} = Inc
{FIND( {template_name_.txt_field1}, {template_name_.txt_field2}, 0)}
-Or-
{FIND( {template_name_.txt_field1}, Inc, 0)}
Result: -1
|