I am trying to split a string in C # as follows:
The incoming line is in the form
string str = "[message details in here][another message here]/n/n[anothermessage here]"
And I'm trying to split it into an array of strings in the form
string[0] = "[message details in here]" string[1] = "[another message here]" string[2] = "[anothermessage here]"
I tried to do it in a way like this
string[] split = Regex.Split(str, @"\[[^[]+\]");
But this does not work correctly, I just get an empty array or strings
Any help would be appreciated!
user1875195
source share