[Overview][Resource strings][Constants][Types][Procedures and functions][Index] Reference for unit 'strutils' (#rtl)


Extract the N-th delimited part from a string.


Source position: strutils.pp line 179

function ExtractDelimited(

  N: Integer;

  const S: string;

  const Delims: TSysCharSet





Which word to extract



String to extract word from



Characters to use as word delimiters.

Function result

N-th word


ExtractDelimited extracts the N-th part from the string S. The set of characters in Delims are used to mark part boundaries. When a delimiter is encountered, a new part is started and the old part is ended. Another way of stating this is that any (possibly empty) series of characters not in Delims, situated between 2 characters in Delims, it is considered as piece of a part. This means that if 2 delimiter characters appear next to each other, there is an empty part between it. If an N-th part cannot be found, an empty string is returned. However, unlike ExtractWord, an empty string is a valid return value, i.e. a part can be empty.

The pre-defined constant StdWordDelims can be used for the Delims argument. The pre-defined constant Brackets would be better suited the Delims argument e.g. in case factors in a mathematical expression are searched.



See also



Extract a word from a string, starting at a given position in the string.



Extract the N-th word out of a string.



Extract a word from a string, and return the position where it was located in the string.

Documentation generated on: Mar 17 2017