How to Split a Delimited String in .NET

If you have a delimited string in your program and you want to split it into individual strings you can use Split method of string class as follows:

string s = "Microsoft,Intel,Oracle,HP,Sony,IBM";
string[] companies = s.Split(new char[] { ',' });



About author

User avatar

Waqas Anwar

Founder of, Senior Consultant, Microsoft .NET and Web Technologies