Connecting Tech Pros Worldwide Help | Site Map

delete chars until end of line

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 18th, 2007, 08:55 AM
RicK
Guest
 
Posts: n/a
Default delete chars until end of line

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, 10:55 AM
Jim Langston
Guest
 
Posts: n/a
Default 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, 10:05 AM
RicK
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.