Convert Text with newlines to a List<String>
- by Vaccano
I need a way to take a list of numbers in string form to a List object.
Here is an example:
string ids = "10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19";
List<String> idList = new List<String>();
idList.SomeCoolMethodToParseTheText(ids); <------+
|
foreach (string id in idList) |
{ |
// Do stuff with each id. |
} |
|
// This is the Method that I need ----------------+
Is there something in the .net library so that I don't have to write the SomeCoolMethodToParseTheText myself?