How to split a string into array by another string in C#

To split a string by another string separator, we can use Split function of C#.

Example code

In below example, we are converting a comma-separated string into a list of string.

string nodeUrls = ",,";

List<string> nodeList = nodeUrls.Split(new string[] { "," }, StringSplitOptions.None).ToList();
Buy Me A Coffee