Unfortunately, there seems to be no string.Split(string separator), only string.Split(char speparator).
I want to break up my string based on a multi-character separator, a la VB6. Is there an easy (that is, not by referencing Microsoft.VisualBasic or having to learn RegExes) way to do this in c#?
EDIT: Using .NET Framework 3.5.
String.Split() has other overloads. Some of them take string[] arguments.
string original = "first;&second;&third";
string[] splitResults = original.Split( new string[] { ";&" }, StringSplitOptions.None );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With