C# assigning elements of a list to a list of variables -
in perl 1 can following
($a, $b, $c) = split(',', "aaa,bbb,ccc");
does know if there equivalent in c# other doing following?
var elements = "aaa,bbb,ccc".split(','); var = elements[0]; var b = elements[1]; var c = elements[2];
or there alternative doing above more concisely?
no there no other way in c#. there hope in .net - namely f# :d do
let [| a; b; c |] = "aaa,bbb,ccc".split(',')
Comments
Post a Comment