M
Mobileboy36
Hi group,
Look at this little piece of code:
Dim test As String
Dim Sepken As Char() = {Chr(13), Chr(10)}
Dim message As String = "123" & vbCrLf & "456"
Dim En As IEnumerator
En = message.Split(Sepken).GetEnumerator
While En.MoveNext
test = En.Current
End While
The split function seems to create an array with 3 elements:
"123", "" and "456".
The enumerator returns 3 value for en.current:
"123", "" and "456".
Where does the empty string come from?
Am I doing something wrong? Should I really use an if structure to filter
away the empty string?
Best regards,
Mobile Boy
Look at this little piece of code:
Dim test As String
Dim Sepken As Char() = {Chr(13), Chr(10)}
Dim message As String = "123" & vbCrLf & "456"
Dim En As IEnumerator
En = message.Split(Sepken).GetEnumerator
While En.MoveNext
test = En.Current
End While
The split function seems to create an array with 3 elements:
"123", "" and "456".
The enumerator returns 3 value for en.current:
"123", "" and "456".
Where does the empty string come from?
Am I doing something wrong? Should I really use an if structure to filter
away the empty string?
Best regards,
Mobile Boy