Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get specific line
#2
You sorta already have an answer in this thread:
<!-- l --><a class="postlink-local" href="http://bpforums.info/viewtopic.php?f=9&t=645">viewtopic.php?f=9&t=645</a><!-- l -->

If we just alter the code a little bit, we can get it to do exactly what you want!
[code2=vbnet]Public Function ReadLine(ByVal containing As String)
If (TextBox1.Text.Contains(containing)) Then
'Now, we need to find which line index contains the thing
Dim lineIndex As Integer = TextBox1.GetLineFromCharIndex(TextBox1.Text.IndexOf(containing))
'Now, let's return the line
Dim lines As New List(Of String)
lines.AddRange(TextBox1.Text.Split(vbNewLine))


Return lines.Item(lineIndex)
End If
End Sub[/code2]

And there you go! Now to get the entire line, you can simply do something like this:
[code2=vbnet]MsgBox(ReadLine("blabla"))[/code2]
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Get specific line - by brco900033 - 10-24-2012, 08:24 AM
Re: Get specific line - by brandonio21_phpbb3_import2 - 10-24-2012, 08:23 PM
Re: Get specific line - by brco900033 - 10-26-2012, 09:26 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)