I want to scan row and give msgbox if equal. Excuse me?
I have a project. I want it to give a warning if it finds any word from the lines in a text in other content. How can I do that? So it will do a kind of search, but it will scan the lines. For example;
Code:
Dim Text_1 As String = "VbForums
csForums
GlobalForums
JaForums
DeForums
EliteForums"
Dim Text_2 As String
Public Sub Scan_Text()
Find_Text = Text_2
If Text_1.Scan = Text_2 Then
Msgbox("Find Text")
End If
End Sub
Re: I want to scan row and give msgbox if equal. Excuse me?
If I understand well: if you find any of the word of text_1 in text_2, you have a warning ?
first, don't use a string for Text_1 but a list (of string) to store you "warning words"
after it's pretty easy :
Code:
Dim text_2 As String = "this sentence has 2 forbiden words : csForums and DeForums"
Dim Text_1 As New List(Of String) From {{"VbForums"}, {"csForums"}, {"GlobalForums"}, {"JaForums"}, {"DeForums"}, {"EliteForums"}}
For Each word As String In Text_1
If text_2.Contains(word) Then
MessageBox.Show("warning, the sentence contains the word : " & word)
End If
Next
Re: I want to scan row and give msgbox if equal. Excuse me?
Quote:
Originally Posted by
Delaney
If I understand well: if you find any of the word of text_1 in text_2, you have a warning ?
first, don't use a string for Text_1 but a list (of string) to store you "warning words"
after it pretty easy :
Code:
Dim text_2 As String = "this sentence has 2 forbiden word : csForums and DeForums"
Dim Text_1 As New List(Of String) From {{"VbForums"}, {"csForums"}, {"GlobalForums"}, {"JaForums"}, {"DeForums"}, {"EliteForums"}}
For Each word As String In Text_1
If text_2.Contains(word) Then
MessageBox.Show("warning, the sentence contains the word : " & word)
End If
Next
Thank you :p