Programming Tips - dotnet: split a string on single character or a list of strings

Date: 2022jan14 Language: C# Platform: .net, dotnet Keywords: split, string Q. dotnet: split a string on single character or a list of strings A. The String.Split() method has several useful overrides. You can split a string on a single character:
string[] cells = lineIn.Split(',');
You can split on selection of strings:
string[] a = timeIn.Split(new string[] { ":", ";" }, StringSplitOptions.None);