I want to split a string like this:
"---hello--- hello ------- hello --- bye"
into an array like this:
"hello" ; "hello ------- hello" ; "bye"
I tried it with this command:
test.Split(new string[] {"---"}, StringSplitOptions.RemoveEmptyEntries);
But that doesn't work, it splits the "-------" into 3 this "---- hello".
Edit:
I can't modify the text, it is an input and I don't know how it looks like before I have to modify it.
An other example would be:
--- example ---
--------- example text --------
--- example 2 ---
and it should only split the ones with 3 hyphens not the one with more.