(Moderator)
Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
Delphi 2006 Professional
|
Re: Split-Funktion in Delpi???
25. Sep 2003, 08:34
Delphi-Quellcode:
function splitOutIndex(Source: String; Delimiter: String; Index: Integer): String;
var count, number: Integer;
giveback: String;
begin
count := 1;
number := 0;
giveback := '';
while (count <= length(Source)) and (number <= index) do
begin
if copy(Source, count, length(Delimiter)) = Delimiter then
begin
number := number + 1;
count := count + length(Delimiter);
end else begin
if number = Index then giveback := giveback + Source[count];
count := count + 1;
end;
end;
result := giveback;
end;
Jens Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
|