Dim sSource As String = ComboBox1.Text 'String that is being searched
Dim sDelimStart As String = "کد" 'First delimiting word
Dim sDelimEnd As String = "قیمت" 'Second delimiting word
Dim nIndexStart As Integer = sSource.IndexOf(sDelimStart) 'Find the first occurrence of f1
Dim nIndexEnd As Integer = sSource.IndexOf(sDelimEnd) '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
TextBox2.Text = res 'Display
TextBox3.Focus()
Else
MessageBox.Show("کلمه مورد نظر پیدا نشد")
End If