Skip to main content

TStringArray

TStringArray = array of String

Example

procedure BuildColumns(var Columns: TStringArray);
begin
SetLength(Columns, 3);
Columns[0] := 'OrderNumber';
Columns[1] := '';
Columns[2] := 'Amount';
end;

Usage

TStringArray stores an ordered zero-based sequence of managed Unicode strings for Velox text operations.

State and indexing

  • SetLength(Values, N) creates or resizes the sequence. Newly added elements are initialized to the empty string.
  • An empty array has no elements. It is different from a one-element array whose only value is ''.
  • Length(Values) counts elements. It does not count characters or UTF-16 code units inside those strings.
  • High(Values) is -1 when empty and otherwise identifies the last valid index.
  • Array order and duplicates are preserved unless a called helper explicitly says otherwise.

This distinction matters to delimited data and configuration lists: a blank field can be meaningful, while a missing element may mean that no value was supplied. Define trimming, case comparison, blank retention and delimiter escaping at the calling boundary.

Velox helper boundaries

  • StringsToArray copies TStrings items into a TStringArray.
  • AddStringArrayToStrings appends array values to an existing string list; it does not imply ownership of the list.
  • Join has an explicit include-blank switch. Choose it from the target format rather than dropping blanks by habit.
  • SplitString and RegExExtractAll write through var arrays; treat their output contract as a possible replacement of prior content.

Array assignment does not immediately copy all elements. Replacing an element through one variable can be visible through the other. Changing the length can separate the arrays, but a same-length SetLength call does not. Copy each element into a separately allocated destination when independent editing is required.

Additional Technical Info

TStringArray is registered by the Velox common-string scripting importer. Every element is the current managed Unicode String type, and array indexes are zero-based.

Related Code Library entries

  • String - Unicode element semantics and encoding boundaries.
  • Arrays - shared dynamic-array behavior and safe-copy guidance.

External references

Created 2026-07-15