[Help]Checking Lines[Solved]

Posts 15 of 5 · Page 1 of 1
[Help]Checking Lines[Solved]
So i am trying to code this in richtextbox.text

Code:
If line1(in richtextbox) contains "xxxxx" And line2 contains "xxxx" And line3 contains "xxxx" Then

blah...
Quote Originally Posted by ppl2pass View Post
So i am trying to code this in richtextbox.text

Code:
If line1(in richtextbox) contains "xxxxx" And line2 contains "xxxx" And line3 contains "xxxx" Then

blah...
Rich Text Box doesnot gives line numbers but gives Lines Text, but we can count lines by an integer variable.

Here's what you need to do:

Code:
Dim LineNumber as integer=1
For LineText as string in RichTextBox1.Text
If LineNumber = 1 Then
If LineText.contains("xxxx") Then
'Blah Blah Blah
End If
End If
LineNumber+=1
Next
We counted the line numbers. And by checking the line number we can check that it contains certain text or not !!!

Hope this helps
Quote Originally Posted by MJLover_2 View Post
Rich Text Box doesnot gives line numbers but gives Lines Text, but we can count lines by an integer variable.

Here's what you need to do:

Code:
Dim LineNumber as integer=1
For LineText as string in RichTextBox1.Text
If LineNumber = 1 Then
If LineText.contains("xxxx") Then
'Blah Blah Blah
End If
End If
LineNumber+=1
Next
We counted the line numbers. And by checking the line number we can check that it contains certain text or not !!!

Hope this helps
If I remember it correct that doesn't work if you only have 1 line... But i'm not sure.
Quote Originally Posted by Zoom View Post


If I remember it correct that doesn't work if you only have 1 line... But i'm not sure.
It will surely work. Tested on single line
You got me worried for a minute. lol
Spam Removed, @ Godlike, Report it, posting spam in response to spam is still spam

@ MJ, if you want to have fun and write a thanks to your alt form your main account, send yourself a VM
Posts 15 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?