I\'ve been using the Split()
method to split strings, but this only appears to work if you are splitting a string by a character. Is there a way to split a
There is an overload of Split that takes strings.
"THExxQUICKxxBROWNxxFOX".Split(new [] { "xx" }, StringSplitOptions.None);
You can use either of these StringSplitOptions
So if the string is "THExxQUICKxxxxBROWNxxFOX", StringSplitOptions.None
will return an empty entry in the array for the "xxxx" part while StringSplitOptions.RemoveEmptyEntries
will not.