string manip help

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2009
Posts: 10
Reputation: tableray is an unknown quantity at this point 
Solved Threads: 0
tableray tableray is offline Offline
Newbie Poster

string manip help

 
0
  #1
Jan 15th, 2009
lets say i have a text file with the string "ffffffffff" in it and i want to insert "666" after the 2nd "f" in it.. how to do it? i tried the following and it doesnt work..
  1. Dim stream As New System.IO.StreamWriter("xxx.txt")
  2. stream.Write("ffffffffff")
  3. stream.BaseStream.Position = 2
  4. stream.Write("666")
  5. stream.Close()
i tried stream.BaseStream.Seek(2, SeekOrigin.Begin) and it doesnt work too..
Last edited by Ancient Dragon; Jan 15th, 2009 at 8:09 pm. Reason: add code tags
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 276
Reputation: rapture has a spectacular aura about rapture has a spectacular aura about 
Solved Threads: 37
rapture rapture is offline Offline
Posting Whiz in Training

Re: string manip help

 
0
  #2
Jan 15th, 2009
Will the position change?

I would think you could use String.Insert()
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 10
Reputation: tableray is an unknown quantity at this point 
Solved Threads: 0
tableray tableray is offline Offline
Newbie Poster

Re: string manip help

 
0
  #3
Jan 15th, 2009
can u explain? i still cant get it..
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 276
Reputation: rapture has a spectacular aura about rapture has a spectacular aura about 
Solved Threads: 37
rapture rapture is offline Offline
Posting Whiz in Training

Re: string manip help

 
0
  #4
Jan 15th, 2009
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC