I need to split a string like "aaa-bbb/ccc:ddd", based ont the following delimiters: -,/,:. I would like to get an array like:
I tried using Regex.Split, but I can only manage to get an array with no deliminters (aaa, bbb, ccc, ddd) or another one like: aaa, -, bbb, /
I would like to avoid working from this last version and then appending the delimiters to the text.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Str As String = "aaa-bbb/ccc:ddd"
Dim pattern As String = "(-)|(/)|(:)"
For Each result As String In Regex.Split(Str, pattern).Where(Function(s) s <> "-" And s <> ":" And s <> "/")