On Fri, 23 Jul 2004 12:30:01 -0700, ltt19 wrote:
Hi,
I want to read line by line in a variable, but it could not be foward only , it need to be forward and backward, it also needs to say me which line it is reading. I do not know if it is possible.
Thanks in advance
ltt19
If you have a very large string and want to read through it, check out the
StringReader class. It allows you to read through a string with methods
like .Read and .ReadLine and .Peek:
Dim sRdr As New StringReader(sSomeLongString)
Dim sLine As String
sLine = sRdr.ReadLine()
It does not seem to allow backward navigation, however.
You can also use a MemoryStream with a array of characters:
Imports System.Text
Dim oMStrm As New MemoryStream(Encoding.Default.GetBytes(sSomeLargeS tring))
The MemoryStream allows seeking.
Hope this helps
--
Chris
dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.