Connecting Tech Pros Worldwide Help | Site Map

delete chars until end of line

RicK
Guest
 
Posts: n/a
#1: Jul 18 '07
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

Jim Langston
Guest
 
Posts: n/a
#2: Jul 18 '07

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.


RicK
Guest
 
Posts: n/a
#3: Jul 20 '07

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