Risolto!!!!!!!!!!!!!!!!!!!!!!
Avevo tempo da perdere e ho scritto una funzione che fa al caso mio.
Delimitatore inizio -------> textbox1.text="("
Delimitatore fine -------> textbox2.text = ")"
codice:
Dim TestString As String = "abc(defg). hilmn opqrs (tuv) z."
Dim TestArray() As String = Split(TestString, TextBox1.Text)
Dim LastNonEmpty As Integer = -1
For i As Integer = 0 To TestArray.Length - 1
If TestArray(i) <> TextBox1.Text Then
LastNonEmpty += 1
TestArray(LastNonEmpty) = TestArray(i)
End If
Next
ReDim Preserve TestArray(LastNonEmpty)
If TextBox1.Text <> TextBox2.Text Then
Dim stringa As String
For i As Integer = 0 To TestArray.Length - 1
stringa = TestArray(i)
If stringa.IndexOf(TextBox2.Text) <> -1 Then
TestArray(i) = Left(stringa, stringa.IndexOf(TextBox2.Text))
Else
TestArray(i) = String.Empty
End If
Next
End if
Alla fine TextArray conterrà:
defg
tuv
Fin'ora l'ho testata parecchie volte e funziona.