Registriert seit: 11. Mai 2008
Ort: Kühlungsborn
446 Beiträge
Delphi 2009 Professional
|
Re: Stelle aus Text herauskopieren?
12. Jun 2009, 17:36
So sähe das dann aus:
Delphi-Quellcode:
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils;
function GetRandomString : string;
var
i : Integer;
begin
for i := 0 to 20 - 1 do
Result := Result + Chr(Random(26) + Ord('A'));
end;
var
RandomString : string;
PartitialString : string;
begin
Randomize;
RandomString := Format('%s - %s (%s)', [GetRandomString, GetRandomString, GetRandomString]);
writeln(RandomString);
PartitialString := Trim(Copy(RandomString, Pos('-', RandomString) + 1, Pos('(', RandomString) - Pos('-', RandomString) - 1));
writeln(PartitialString);
readln;
end.
Fridolin Walther
|
|
Zitat
|