I want to separate each item in a list, but within each item, divide the item if it contains the e.g. will show: However, any LINQ is I I can use it, which will provide the following list: I can use it: ... but it seems winded too long, when I am some LINQ may be more elegant To redress the consequences of dividing each code, Is:
string [] name = {"Peter: John: Connor", "Paul", "Mary: Blyth"}; Name.Dump ();
Peter: John: Connor Paul Marie: Blythe
Peter John Connor Paul Mary Bliley
foreach (different person in name) {x = person.split (":"). ToList (); Foreach (var personinlist in x) {// personinlist}}
: < / Div>
:
names.SelectMany (n = & gt; n.Split (':')). Dump ();
No comments:
Post a Comment