title: How remove line of string from textbox vb.net
body: <p>I have a loop which extracts the string from the <code>textbox</code> line by line and multiple conditions for each iteration. if a condition is true i want to remove the line from the <code>textbox</code> is there a way to remove the entire line from the string? Here is my code..</p>
  
  <pre><code>Dim fileContents As String
      fileContents = txtOCR.Text
      Dim strSet(1000) As String
      Dim a As Integer = 1
      Dim words As String
  
      MsgBox(fileContents)
  
      For i = 1 To fileContents.Length
          Dim xx As String = Mid(fileContents, i, 1)
  
          'parse text line by line
          If xx = Chr(10) Then
              If Mid(fileContents, i - 1, 1) = Chr(13) Then
                  strSet(i) = Mid(fileContents, a, (i - a) - 1)
  
      'count words
                  Dim intCount As Integer
                  intCount = 1
                  For b = 1 To Len(strSet(i))
                      If Mid(strSet(i), b, 1) = " " Then
                          intCount = intCount + 1
                      End If
                  Next
  
          If txtTitle.Text = "" And intCount = 1 Then
                  txtTitle.Text = " " &amp; strSet(i)
  
      ElseIf intCount = 1 Then
                      If strSet(i).Contains("BY") = True Then
                          GoTo lastline
  
                      ElseIf strSet(i).Contains("by") = True Then
                          GoTo lastline
  
                      ElseIf strSet(i).Contains("By") = True Then
                          GoTo lastline
  
  
                      Else
                          txtTitle.Text = txtTitle.Text + " " &amp; strSet(i)
  
                      End If
  
              End If
  
              a = i
  
          End If
      Next
  </code></pre>
  
  <p>Also is it possible to copy the next line of string when the keyword "BY" is found? I need help this is for my thesis project..</p>