Connecting Tech Pros Worldwide Help | Site Map

delete chars until end of line

  #1  
Old July 18th, 2007, 09:55 AM
RicK
Guest
 
Posts: n/a
Hy guys,

I'm sorry for my bad english,

I have a problem writing a text file:

I have this 2 lines:
abcd = 0;zzzzzzzzzzzzzzzzzzzz
fghi = 1;
and I want delete all next ';' (zzzzzzzzzzzzzzz) but not erase the second
line;

regards
RicK

  #2  
Old July 18th, 2007, 11:55 AM
Jim Langston
Guest
 
Posts: n/a

re: delete chars until end of line


"RicK" <rmarfisiNOAT@__SPAM_AT_SPAMinwind.itwrote in message
news:dukni.60$Yc5.40@nntpserver.swip.net...
Quote:
Hy guys,
>
I'm sorry for my bad english,
>
I have a problem writing a text file:
>
I have this 2 lines:
abcd = 0;zzzzzzzzzzzzzzzzzzzz
fghi = 1;
and I want delete all next ';' (zzzzzzzzzzzzzzz) but not erase the second
line;
You say you have problem writing a text file. Which mean that you have it
in memory somehow to be able to write it (even if you read it from another
file).

Without knowing the specifics, it sounds as simple as getting rid of
everything past the ;. It may be as simple as:

Line = Line.substr(0, Line.find_first_of(';') );

Hard to know without seeing your code.


  #3  
Old July 20th, 2007, 11:05 AM
RicK
Guest
 
Posts: n/a

re: delete chars until end of line


Jim Langston il 12:50 PM, mercoledì 18 luglio 2007 ha scritto:

Quote:
Line = Line.substr(0, Line.find_first_of(';') );
>
ok, it's work

thank a lot
riccardo
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Confused with error using ofstream rEvolution27@gmail.com answers 15 March 4th, 2007 10:35 PM
Maximum char array size? Walter Dnes (delete the 'z' to get my real address answers 11 November 14th, 2005 08:35 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 03:15 AM
MS SQL Server - a plethora of limitations... Jeager answers 13 July 20th, 2005 05:01 AM