Extract a word from a string, and return the position where it was located in the string.
Source position: strutils.pp line 219
function ExtractWordPos( |
N: Integer; |
const S: string; |
const WordDelims: TSysCharSet; |
out Pos: Integer |
):string; |
N |
|
Which word to extract. |
S |
|
String to extract a word from. |
WordDelims |
|
Characters to use as word delimiters. |
Pos |
|
On return, contains the position of the N-th word. |
N-th word of the string, or empty if N is out of range.
ExtractWordPos extracts the N-th word from the string S and returns the position of this word in Pos. The set of characters in WordDelims are used to mark word boundaries. A word is defined as any non-empty sequence of characters which are not present in WordDelims : if a character is not in WordDelims , it is considered as part of a word. If an N -th word cannot be found, an empty string is returned and Pos is zero.
Unlike ExtractDelimited, an empty string is not a valid return value, i.e. is not a word. If an empty string is returned, the index N was out of range.
The predefined constant StdWordDelims can be used for the WordDelims argument.
None.
|
Extract the N-th word out of a string. |
|
|
Extract a word from a string, starting at a given position in the string. |
|
|
Check for the presence of a word in a string. |
|
|
Count the number of words in a string. |
|
|
Search position of Nth word in a string. |