- Home /
How do I make a list of lists?
Hi
I've read a couple of questions about this but none seem to work for me. I have a list of strings created by:
private var wave1 : List.<String> = new List.<String>();
I want several waves, and I want each of those to be stored in a list too. Something like:
private var waveArray : List.< List > = new List.< List >();
Obviously the above line doesn't work - how should I write this?
Thanks
Comment
Answer by Danz0r77 · Apr 18, 2013 at 10:33 AM
Ah, this works:
private var waveArray : List.< List.<String> > = new List.< List.<String> >();
You gave me the right idea - think the syntax was just a bit wrong.
Cheers
Answer by goo-muffin · Apr 18, 2013 at 10:12 AM
var l :List<List<String>> = new List<List<String>>;
or it is
var l :List<List<String>> = new ArrayList<ArrayList<String>>;