I have a string that has a delimited format like this:
orgname: firstname lastname, firstname lastname;
(this can repeat with orgnames and variable number of names for each org)
Example:
**XXX University**: Martha Zander, Rick Anderson; **Albert School**: Nancy Vanderburg, Eric Towson, George Branson; **Hallowed Halls**: Jane Goodall, Ann Crabtree, Rick Grey, Tammy Hudson;
The resultant string needs to be grouped and sorted by orgname and then lastname like this:
**Albert School**: George Branson, Eric Towson, Nancy Vanderburg;
**Hallowed Halls**: Ann Crabtree, Jane Goodall, Rick Grey, Tammy Hudson;
**XXX University**: Rick Anderson, Martha Zander;
I have gotten this far:
string[][] splitThis = staff.Split(';').Select(s => s.Split(':')).ToArray();
This gives me an array split up by orgname and then I am stuck after this.
I know I need a multidimensional array with orname, firstname, lastname but I don't know how to populate, group and sort it to get the proper result.
Mary Jane WatsonorDale Earnhardt Jr.?PersonandOrganization).