Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I remove a .txt from a file.

Status
Not open for further replies.

jvff

Programmer
Apr 1, 2001
64
BR
Hello,
I would like to ask, I hava a program that creates a file FileName.fpp and I would like to create an error file that is FileName.err but not FileName.fpp.err. Thanks for any replies,

JVFF
 
How about:

AnsiString str = Edit1->Text; // Get a copy of the string
int dotpos = str.LastDelimiter("."); // Find index of dot
if (dotpos != 0) str.SetLength(dotpos-1); // Remove dot and tail
Label1->Caption = str + ".err"; // And new tail and show result
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top