实现你的功能.两个函数,一个取反字符串,一个取路径,给分吧!
function StrReverse(str:string):string;
var i:integer;
begin
result:='';
for i:=Length(str) downto 1 do
begin
Result:=Result+Copy(str,i,1);
end;
end;
function GetString(sourceStr: string
iCount: integer): string;
var i,j,LastPos:integer;
ss:string;
begin
i:=0;
ss:=StrReverse(SourceStr);
while i<iCount do
begin
j:=pos('/',ss);
if j>0 then
begin
inc(i);
ss:=Copy(ss,j+1,length(ss)-j+1);
LastPos:=j;
end
else break;
end;
ss:=StrReverse(ss);
Result:=ss;
end;