943,718 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 423
  • VB.NET RSS
Jan 15th, 2009
0

string manip help

Expand Post »
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..
VB.NET Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tableray is offline Offline
10 posts
since Jan 2009
Jan 15th, 2009
0

Re: string manip help

Will the position change?

I would think you could use String.Insert()
Reputation Points: 155
Solved Threads: 41
Posting Whiz in Training
rapture is offline Offline
294 posts
since Jul 2007
Jan 15th, 2009
0

Re: string manip help

can u explain? i still cant get it..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tableray is offline Offline
10 posts
since Jan 2009
Jan 15th, 2009
0

Re: string manip help

Reputation Points: 155
Solved Threads: 41
Posting Whiz in Training
rapture is offline Offline
294 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Complier for flash drive
Next Thread in VB.NET Forum Timeline: adding items from combobox as submenu items





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC