It looks like you need a new string method:
public static class StringExtensions { public static string[] Split(this string self, string separator, StringSplitOptions options) { return self.Split(new[] { separator }, options); } }
Use it as follows:
string[] mystrings = test.Split("split", StringSplitOptions.RemoveEmptyEntries);
Now you have to decide whether or not to represent him.
For several delimiters, you can fix the options parameter (or put it in front, which will look unnatural based on other "overloads"):
public static class StringExtensions {
And use:
string[] mystrings = test.SplitAndRemoveEmptyEntries("banana", "split");
source share