Kylix
Tips

NEW TIPS
Database (112)
Files (567)
Forms (583)
Graphic (520)
IDE (439)
Indy (410)
Internet / LAN (575)
IntraWeb (432)
Kylix (426)
Math (546)
Misc (565)
Multimedia (473)
Objects/
ActiveX (486)

OpenTools API (423)
Printing (428)
Strings (560)
System (705)
VCL (575)

Search Tip
Top15
Add new Tip

Forum

...extract the filename of an URL?
Author: Rainer Kümmerle
Homepage: http://www.thinklazy.de
[ Print tip ]    

Tip Rating (4):  
     



function ExtractUrlFileName(const AUrl: string): string
var 
  
i: Integer; 
begin 
  
i := LastDelimiter('/', AUrl);
  Result := Copy(AUrl, i + 1, Length(AUrl) - (i)); 
end

procedure TForm1.Button1Click(Sender: TObject); 
var 
  
s: string
begin 
  
s := ExtractUrlFileName('http://www.delphimania.de/index.php'); 
  ShowMessage(s);  //index.php 
end

Rate this tip:

poor
very good


Copyright © Torry's Delphi Pages Torry's Delphi Pages Maintained by Simon Grossenbacher Notes? Comments? Feel free to send... Copyright © 1996-2001