Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Samples

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-24-2011, 02:01 PM
Rad Koder Rad Koder is offline
Junior Member
 
Join Date: Dec 2011
Posts: 3
Post ExtractFileNameEX - Extract File name without extension

The following function of Object Pascal (Delphi) will extract the file name without extension.

Code:
function ExtractFileNameEX(const AFileName:String): String;
 var
   I: integer;
 begin
    I := LastDelimiter('.'+PathDelim+DriveDelim,AFileName);
        if (I=0)  or  (AFileName[I] <> '.')
            then
                 I := MaxInt;
          Result := ExtractFileName(Copy(AFileName,1,I-1));
 end;
Feel Free to use this Function
Happy Coding
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:25 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.