Results 1 to 3 of 3

Thread: [Resolved][2008]Find String In String IndexOf("flowers")

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    74

    Resolved [Resolved][2008]Find String In String IndexOf("flowers")

    Hi
    The problem is that the code cant find word flowers from *.txt file. I added msgbox & looped all 5 lines & I see that the flowers are there. if i change flowers to BIOS, then the code will find the word. So im little lost hire, Why it cant find flowers?

    Code:
           Dim myOpenFileDialog As New OpenFileDialog()
            myOpenFileDialog.CheckFileExists = True
            myOpenFileDialog.DefaultExt = "txt"
            myOpenFileDialog.InitialDirectory = "C:\"
            myOpenFileDialog.Multiselect = False
            If myOpenFileDialog.ShowDialog = DialogResult.OK Then
    
                Dim a() As String = Split(My.Computer.FileSystem.ReadAllText(myOpenFileDialog.FileName), Environment.NewLine)
                Dim r As Integer
                Dim i As Integer
                For i = 0 To a.GetUpperBound(0)
    
                    r = a(i).IndexOf("flowers")
                    If r > 0 Then ' if found flowers
                        MsgBox("Found word,:" & a(i))
                        Exit For
                    End If
                Next            
            End If
    *txt file contents:
    Code:
    [BIOS]
    Ver=AB60S00P
    [BIOS]
    Ver=AB60S00P
    flowers
    Last edited by goldenix; Apr 5th, 2008 at 10:23 AM.

    M.V.B. 2008 Express Edition

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width