STRFIELD |
DEVELOPER |
|
|
Purpose |
STRFIELD returns the sub string located between the nth-1 and nth occurrence for a specified delimiter. |
Syntax |
variable = COUNT (operand1,operand2,operand 3{,operand 4}) |
Operation |
operand1 is any valid alphanumeric string |
Remarks |
The delimiter specified in operand 2 can more than one character. |
Example |
$A = STRFIELD(“The:Quick:Brown”,“:”,1,$DELIM)....................gives $A = “The” $A = STRFIELD (“The:Quick:Brown”,“:”,2,$DELIM)....................gives $A = “Quick” $A = STRFIELD (“The:Quick:Brown”,“:”,3,$DELIM)....................gives $A = “Brown” In the first two examples $DELIM is updated with “:". In the last case $DELIM is returned as a null string, thereby providing an indicator that all of the string has been processed. If operand 2 (the delimiter) is not found, all of operand 1 (the InString) is returned to $A. If operand 2 (the delimiter) is a null string, a null string is returned. If operand 3 (the numeric) is specified as 0, the first sub-string is returned. |
Topic ID: 520122