本文整理自网络,侵删。
function GetLastName(const fn: string): string;var i:Integer; s:string;begin s := trim(fn); if s[Length(s)]='\' then s := Copy(s,1,Length(s)-1);
while Pos('\',s)>0 do begin i := Pos('\',s); s := Copy(s,i+1,Length(s)-i); end; Result := s;end;
procedure TForm1.FormCreate(Sender: TObject);varstr:string;begin
caption := GetLastName('\sfsdf\sdfsdfs\电影名称');end;
相关阅读 >>
Delphi 生成xml 方法 与 Delphi txt文件操作
更多相关阅读请进入《Delphi》频道 >>