Ron,
As Alex stated, String.Split splits based on individual characters. If you
want to split based on words I would recommend Strings.Split or RegEx.Split.
There are three Split functions in .NET:
Use Microsoft.VisualBasic.Strings.Split if you need to split a string based
on a specific word (string). It is the Split function from VB6.
Use System.String.Split if you need to split a string based on a collection
of specific characters. Each individual character is its own delimiter.
Use System.Text.RegularExpressions.RegEx.Split to split based
on matching patterns.
NOTE: Microsoft.VisualBasic *is* "DotNet functionality"! There is little
real reason to avoid it altogether. Some classes, such as
Microsoft.VisualBasic.Collection, I avoid altogether as most of the time it
is TOO general. I try not to mix Microsoft.VisualBasic.Strings functions
with System.String methods that take or return indexes, as VB.Strings uses
base 1 indexes, while System.String uses base 0 indexes, and this mixing
could lead to obscure bugs... VB.Split is one method I will use as
System.String currently does not have an actual equivalent (VS.NET 2005, aka
Whidbey, due out later in 2005, does have a String.Split
http://msdn2.microsoft.com/library/tabh47cf.aspx method that works on
words).
Hope this helps
Jay
"Ron" <anonymous@discussions.microsoft.com> wrote in message
news:171201c4f4f2$d601ed50$a601280a@phx.gbl...[color=blue]
> Hello,
>
> I am trying to parse a string on the newline char. I
> guess vbCrLf is a string constant. How can I parse my
> string - data - on the newline char?
> ...
> data += ASCII.GetString(buffer, 0, bytesRead)
> ...
> Dim parts() As String = data.Split(vbCrLf)
>
> Thanks,
> Ron[/color]