function GetSubString(const aInputText: string; const aSplitChar: string;
aSplitCharIndex: integer): string;
var
i: integer;
StrTemp: WideString;
j :integer;
begin
i := 1;
j :=length(aSplitChar);
StrTemp := (aInputText);
while (length(StrTemp) > 0) and (i <= aSplitCharIndex - 1) do
begin
if j > 1 then
System.Delete(StrTemp, 1, pos(aSplitChar, StrTemp)+1)
else
System.Delete(StrTemp, 1, pos(aSplitChar, StrTemp));
i := i + 1;
end;
if pos(aSplitChar, StrTemp) > 0 then
StrTemp := copy(StrTemp, 1, pos(aSplitChar, StrTemp) - 1);
Result := (StrTemp);
end;