Hier ist schon mal meins:
Delphi-Quellcode:
function Folder(fileName: string): string;
begin
Delete(fileName, 1, Length(ExtractFileDrive(fileName)));
SetLength(fileName, Length(fileName) - Succ(Length(ExtractFileName(fileName))));
Result := ExtractFileName(fileName);
end;
Grüße vom marabu