how could i make that
Source_Source.Text (richtextbox) :
src="test.com"akalsjdjalksdvsrc="another.com"asdbnmslkbjcxv asdas as danms d amsn asdasdsrc="cold.com"asdas as dasd amnbs dma d sdf kjhds fsrc="find.com"asd kja sdasjhk d asdsrc="other.com"a jksdh asksjd hasdjhsrc="found.com"
what if i wanna get random src=" ", for example, if i clicked butten will show message = src="test.com" , another time if i clicked button will show another random, for example src="another.com" ,
my currently code only select first string which = src="test.com" , and i wanna select randoms src="[random test / cold / other / found / find]"
for example my next click can show message for src="find.com" that for example.
my code :
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim sSource As String = Source_Source.Text 'String that is being searched
Dim sDelimStart As String = Search_1.Text 'First delimiting word
Dim sDelimEnd As String = Search_2.Text 'Second delimiting word
Dim nIndexStart As Integer = sSource.IndexOf(sDelimStart) 'Find the first occurrence of f1
Dim nIndexEnd As Integer = sSource.IndexOf(sDelimEnd, nIndexStart + sDelimStart.Length + 1) 'Find the first occurrence of f2
If nIndexStart > -1 AndAlso nIndexEnd > -1 Then '-1 means the word was not found.
Dim res As String = Strings.Mid(sSource, nIndexStart + sDelimStart.Length + 1, nIndexEnd - nIndexStart - sDelimStart.Length) 'Crop the text between
MessageBox.Show(res) 'Display
Else
MessageBox.Show("One or both of the delimiting words were not found!")
End If
End Sub