Hey,
hier wäre noch ne Möglichkeit:
Delphi-Quellcode:
procedure parseWords( const str: string; var tokens: TStringList );
var
i: integer;
buf: string;
j: integer;
begin
i := 1;
while( i <= length(str) )do
begin
if( (ord(str[i]) <= 32) )then
begin
inc(i);
continue;
end
else if( str[i] in ['A'..'z'] )then
begin
j := i;
while( (i<= length(str)) and ((str[i] in ['A'..'z']) or (str[i] in ['0'..'9']) or (str[i] = '_') ) )do
inc(i);
buf := copy(str,j,i-j);
tokens.Add(buf);
end
else
inc(i);
end;
end;