home *** CD-ROM | disk | FTP | other *** search
- unit StriU;
-
- interface
- function Strip(X: string): string;
-
- implementation
-
- function Strip;
- var Continue: boolean;
- L: integer;
- begin
- Continue := true;
- while Continue do
- begin
- L := ord(X[0]);
- if L < 1 then
- Continue := false
- else
- if X[L] = ' ' then
- dec(X[0])
- else
- Continue := false;
- end;
- Continue := true;
- while Continue do
- begin
- L := ord(X[0]);
- if L < 1 then
- Continue := false
- else
- if X[1] = ' ' then
- begin
- dec(X[0]);
- move(X[2],X[1],ord(X[0]));
- end
- else
- Continue := false;
- end;
- if X = ' ' then X := '';
- Strip := X;
- end;
-
- end.
-