you can try a home-made like this: Put it in a "unit XXXX" used by your code...
if you dont use last IDE, as 10 or 11
else, you can use : MyResult := MyVarWithTextSeparatedByXXX.Split(['-']); // MyResult: TArray<string>;
type
TMyArrOfStr = array of string; // for easy usage on many places... Note: Delphi use type-name to identify same types on var/object
function MySplitStringToArrays(const AValue: string; ASeparator: char = '-'): TMyArrOfStr;
var
LText : string;
i, z : integer;
begin
result := [];
//
if Trim(AValue) = '' then
exit;
//
i := 1;
//
begin
repeat
z := Pos(ASeparator, AValue, i);
if (z > 0) then
begin
LText := Copy(AValue, i, z - i);
i := z + 1;
end
else begin
LText := Copy(AValue, i);
end;
//
if Trim(LText) <> '' then
result := result + [LText];
until (z = 0);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
MyResult: TMyArrOfStr;
MyText : string;
begin
MyText := '-- --'; // hello-world-from-Delphi- -';
//
MyResult := MySplitStringToArrays(MyText, '-');
//
Memo1.Text := 'Arrays=' + Length(MyResult).ToString;
Memo1.Lines.AddStrings(MyResult);
end;