Reply to thread

Ok this is what I have now but am getting wierd output??


I have a text file with these entries, (any ole guff)...


dog cat horse fish


Each separated by a tab.


This is my code:


[code=vb]


        Dim strDelimiter As String = ControlChars.Tab


        Dim chrDelimiter As Char() = strDelimiter.ToCharArray()


        Dim strWords As String = srFile1.ReadLine


        Dim strSplit As String() = Nothing


        Dim intX As Integer


        For intX = 1 To 9


            strSplit = strWords.Split(chrDelimiter, intX)


            Dim strNewString As String


            For Each strNewString In strSplit


                MessageBox.Show(strNewString & ControlChars.CrLf)


            Next strNewString


        Next intX


[/code]


Problem is this....output of each loop results in:


dog cat horse fish

dog

dog cat horse fish

dog

cat

horse fish

dog

cat

horse

fish


I know it is to do with the loops and Ive tried just getting one string at a time out of the split array with no joy:(


Back
Top