RE: issue with split function in vb.net
- From: v-kevy@xxxxxxxxxxxxxxxxxxxx (Kevin Yu [MSFT])
- Date: Thu, 19 May 2005 01:58:10 GMT
Hi,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you are unable to split some of your
string lines. If there is any misunderstanding, please feel free to let me
know.
I think the part "line.Split.GetUpperBound(0)" is not necessary in the
code, because the Split method will split according to all delimiters
without specifying the count. So I changed the code to the following. It
works fine on my machine.
Dim strDelim As String = "*~"
Dim delimiter As Char() = strDelim.ToCharArray
Dim split As String() = Nothing
Dim fieldCount As Integer
Dim s As String
split = line.Split(delimiter)
fieldCount = 0
For Each s In split
Dim y As String = s
If y <> "" Then
fieldCount = fieldCount + 1
End If
Next s
Dim strAddress As Object = split.GetValue(fieldCount - 1)
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
.
- Follow-Ups:
- RE: issue with split function in vb.net
- From: NewToThis
- RE: issue with split function in vb.net
- References:
- issue with split function in vb.net
- From: NewToThis
- issue with split function in vb.net
- Prev by Date: Re: ASP.NET requirements? This CAN'T be true
- Next by Date: Disposing in a sealed class
- Previous by thread: issue with split function in vb.net
- Next by thread: RE: issue with split function in vb.net
- Index(es):
Relevant Pages
|