Description
The copyword function accepts up to three of the parameters described below (the last parameter is optional), and returns a value of type string which is formed by copying zero or more words from the first parameter. The term word is used to mean a group of contiguous characters, seperated by another group of characters called deliminators.
Parameters
copyword('example', 1) returns 'example'
copyword(' example ', 1) returns 'example'
copyword('this is an example', 2, 2) returns 'is an'
copyword('example', 2) returns ''
Here are some examples using "," as the deliminstor, to extract fields from comma-deliminated strings.
copyword('1234, name, value', 1, ',') returns '1234'
copyword('1234, name, value', 2, ',') returns ' name'
copyword('1234, name, value', 3, ',') returns ' value'
Portability
Operating Systems: All
Standard Pascal: No