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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -