Solved

editing filename in string

Posted on 2011-03-01
3
184 Views
Last Modified: 2012-05-11
Hi,

I have a string with a filename in it. I need to separate the name form the extension, into two strings. I know how to do this by reading each character and looking for the period. What I am asking, is if there is something in Delphi to do this automatically.
0
Comment
Question by:ChLa
3 Comments
 
LVL 32

Accepted Solution

by:
ewangoya earned 50 total points
Comment Utility
here
procedure TForm1.Button1Click(Sender: TObject);
var
  Ext, FilePart, FileName: string;
begin
  FileName := 'test.txt';
  Ext := ExtractFileExt(FileName);
  FilePart := ChangeFileExt(Filename, '');
  ShowMessage(Ext + '  ' +  FilePart);
end;

Open in new window

0
 
LVL 19

Expert Comment

by:Thommy
Comment Utility
Here is a list of filename functions...

http://www.delphibasics.co.uk/RTL.asp?Name=ExtractFileName
0
 

Author Closing Comment

by:ChLa
Comment Utility
thank you...that saved me a lot of time
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now