Forum: Object-Pascal / Delphi-Language
Delphi
by jaenicke,
9. Aug 2009
Kann man alles machen:function FindNextWord(const AText, APrevWord: string): string;
var
CurPos: PChar;
TempPos: Integer;
begin
Result := '';
TempPos := Pos(APrevWord + ' ', AText);
if TempPos = 0 then
Exit;
CurPos := PChar(Integer(PChar(AText) + TempPos + Length(APrevWord)));
Forum: Object-Pascal / Delphi-Language
Delphi
by jaenicke,
9. Aug 2009
So könntest du es z.B. machen:function FindNextWord(const AText, APrevWord: string): string;
var
CurPos: PChar;
begin
CurPos := PChar(Integer(PChar(AText) + Pos(APrevWord + ' ', AText) + Length(APrevWord)));
SetString(Result, CurPos, Pos(' ', CurPos) - 1);
end;Und dann eben so aufrufen:FindNextWord('Das ist ein Test!', 'ist')