Disclaimer: I am a consultant at Amazon Web Services, and this is my personal blog. The opinions expressed here are solely mine and do not reflect the views of Amazon Web Services (AWS). Any statements made should not be considered official endorsements or statements by AWS.
To split a string by another string separator, we can use Split
function of C#.
In below example, we are converting a comma-separated string into a list of string.
string nodeUrls = "127.0.0.1:2222,127.0.0.1:2223,127.0.0.1:2224";
List<string> nodeList = nodeUrls.Split(new string[] { "," }, StringSplitOptions.None).ToList();