WORDSX – Extend the REXX WORDS function
This function extends the REXX WORDS function to enable you delimit words with
characters different from a blank. As with the WORDS
function, the leading
delimiters are ignored and consecutive delimiters treated as one, returning the number of
delimited word. If the number is greater than the number of words, a null string is returned. The
input string must not contain the “00”x character.
WORDSX(<string>,<delimiter>,<number>)
Where:
<string>
- The string from which to extract the words.
<delimiter>
- The delimiter with which to separate each word.
For example, the following command returns
5
:
WORDSX(“FIVE!FOUR!THREE!TWO!ONE”,”!”,2)
The following command returns
4
:
WORDSX(“.A.B..C.D”,”.”,2) returns 4