unit Unit;
interface
uses
Windows Messages SysUtils Variants Classes Graphics Controls Forms
Dialogs StdCtrls;
type userarray=array of string;
type
TForm = class(TForm)
Edit: TEdit;
Button: TButton;
procedure ButtonClick(Sender: TObject);
private
function split(s: string; dot: char): userarray;
{ Private declarations }
public
{ Public declarations }
end;
var
Form: TForm;
implementation
uses StrUtils;
{$R *dfm}
function TFormsplit(s:string;dot:char):userarray;
var
str:userarray;
ij:integer;
begin
i:=;
j:=;
SetLength(str );
while Pos(dot s) > do
begin
str[j]:=copy(sipos(dots)i);
i:=pos(dots)+;
s[i] := chr(ord(dot)+);
j:=j+;
end;
str[j]:=copy(sistrlen(pchar(s))i+);
result:=str;
end;
procedure TFormButtonClick(Sender: TObject);
var
ur:userarray;
i:Integer;
begin
ur:=split(EditText;);
for i := to do
begin
if length(ur[i])= then Exit;
ShowMessage(ur[i]);
end;
end;
end