There is no need for engineering a Split
function. It already exists, see: Classes.ExtractStrings
.
Use it in a following manner:
program Project1;
{$APPTYPE CONSOLE}
uses
Classes;
var
List: TStrings;
begin
List := TStringList.Create;
try
ExtractStrings([':'], [], PChar('word:doc,txt,docx'), List);
WriteLn(List.Text);
ReadLn;
finally
List.Free;
end;
end.
And to answer the question fully; List
represents the desired array with the elements:
List[0] = 'word'
List[1] = 'doc,txt,docx'