Skip to main content

NameValueSeparator

property NameValueSeparator: Char read write;

Example

procedure ConfigureAssignments(const Items: TStringList);
begin
Items.NameValueSeparator := '=';
Items.Values['Mode'] := 'Test';
end;

Usage

NameValueSeparator specifies the single character separating names from values and defaults to equals.

  • Set the separator before name/value access and keep it stable for the list's lifetime.
  • Choose a non-null character and define escaping at a higher layer if names themselves can contain it.
  • Duplicate names remain possible.

Additional Technical Info

NameValueSeparator is declared by hidden ancestor TStrings and is normally used through a concrete visible descendant such as TStringList. Changing it changes how existing strings are interpreted; it does not rewrite them.

Source-backed behaviour

TStrings.Create initializes the separator to = and the property stores a Char directly. Names, Values, ValueFromIndex and IndexOfName use the first occurrence in each string.

No validation, escaping or whitespace trimming is applied. A value can contain further separator characters because only the first is structural. A null separator has ambiguous PChar/search behaviour and should not be used.

Names and Values interpret entries using this character. Strings exposes the original text.

Official RTL references

Created 2026-07-15