I'm trying to convert a string to string[] using two delimiters and I want delimiters to be null strings in resultant string[] nodes
string source = "(('CO.IN'.bit = C) OR ('CO.IN'.bit = V))";
char[] delimiters = new char[] { '(', ')' };
string[] parts = source.Split(delimiters,StringSplitOptions.None);
The expected result for string[] parts is:
[null]
[null]
'CO.IN'.bit = C
[null]
' OR '
[null]
'CO.IN'.bit = V
[null]
[null]
But the result obtained is:
[null]
[null]
'CO.IN'.bit = C
' OR '
'CO.IN'.bit = V
[null]
[null]
I miss two nodes and I don't understand why.
Can anyone help me please?