SplitString(PChar) Method

Returns a string array that contains the substrings in the buffer that are delimited by null char (#0) and ends with an additional null char.

Namespace: Spring.SystemUtils
function SplitString(const buffer: PChar): TStringDynArray; overload;

Parameters

buffer
Type: PChar

Return Value

Type: TStringDynArray

 

procedure TestSplitNullTerminatedStrings;
var
  buffer: string;
  strings: TStringDynArray;
  s: string;
begin
  buffer := 'C:'#0'D:'#0'E:'#0#0;
  strings := SplitString(PChar(buffer));
  for s in strings do
  begin
    Writeln(s);
  end;
end;