Sign in Join
FPDoc Onlineexperiment

GetNextDelimitedItem function

In unit LazStringUtils

Gets the next delimited value in List starting at the specified position.

Declaration

pascal
function GetNextDelimitedItem(const List: string; Delimiter: char; 
 var Position: Integer): string

Arguments

List

List of delimited values examined in the routine.

Delimiter

Delimiter character used to separate values in the list.

Position

Initial position in the list where the characters are examined

Function result

Value for the list item at the specified position.

Description

GetNextDelimitedItem is a String function used to get the next item in a delimited list of items starting at the specified position.

List contains the list of values examined in the routine.

Delimiter is the character used to separate item values in List.

Position contains the initial character position in List examined in the routine.

GetNextDelimitedItem iterates over the characters in List starting at the character in Position. When the character in Delimiter is encountered, the characters starting at Position and prior to the position for the Delimiter are copied into the return value.

The value in Position is incremented to skip both the character values and the delimiter for the list item.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.