Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > delete chars until end of line

Reply
Thread Tools

delete chars until end of line

 
 
RicK
Guest
Posts: n/a
 
      07-18-2007
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

 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      07-18-2007
"RicK" <rmarfisiNOAT@__SPAM_AT_SPAMinwind.it> wrote in message
news:dukni.60$...
> 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.


 
Reply With Quote
 
 
 
 
RicK
Guest
Posts: n/a
 
      07-20-2007
Jim Langston il 12:50 PM, mercoledì 18 luglio 2007 ha scritto:


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


ok, it's work

thank a lot
riccardo
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to truncate char string fromt beginning and replace chars instring by other chars in C or C++? Hongyu C++ 9 08-08-2008 12:18 PM
Delete until end of line Joey Martin ASP General 2 04-19-2007 02:47 PM
Floats to chars and chars to floats Kosio C Programming 44 09-23-2005 09:49 AM
List of tables, nowrap until end of available width Sjaakie HTML 4 03-22-2005 10:52 AM
receiving ??? chars instead of "special" chars M.Posseth ASP .Net Web Services 3 11-16-2004 07:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57