Returns a specified number of words from a string, beginning at a particular word.
Syntax
FINDWORD(string,[start,number,delimiter])
Arguments
| Argument |
Description |
Default |
| string |
The string to search. |
|
| [start] |
The number (greater than 0) of the first word to retrieve from string. |
1 |
| [number] |
The number (greater than 0) of words to retrieve from string. If Enrichment does not find number words, the return contains all words found plus trailing blanks from string. |
1 |
| [delimiter] |
Single character used to denote word breaks. |
''(blank) |
Results
| Result |
Description |
| Return |
A substring of string that contains the retrieved words. |
| %%RC |
One of the following: |
| |
-1 |
start is less than or equal to 0 |
| |
-2 |
number is less than or equal to 0 |
| |
0 |
No error. |
| |
1 |
start word not found |
| |
2 |
number words not found |
| %%RM |
A null string (''). |
| %%RV |
The character position in string at which Enrichment finds start. |
Examples
| Function Call |
Return |
%%RC |
%%RV |
| FINDWORD(' This is a string',1,1) |
'This' |
0 |
2 |
| FINDWORD('',1,1) |
'' |
1 |
0 |
| FINDWORD(' This is it! ',2,2) |
'is it!' |
0 |
7 |
| FINDWORD(' This is it! ',2,42) |
'is it!' |
2 |
7 |
| FINDWORD(' This is a string',4,1,'') |
'string' |
0 |
12 |