Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
List of Lists example
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { List<List<int>> myList = new List<List<int>>(); List<int> nint = new List<int>(); nint.Add(123); nint.Add(654); nint.Add(234); nint.Add(789); foreach(int item in nint) myList.Add(new List<int>{item}); //myList.Add(new List<string> { "c", "d", "e" }); //myList.Add(new List<string> { "qwerty", "asdf", "zxcv" }); //myList.Add(new List<string> { "a", "b" }); // To iterate over it. foreach (List<int> subList in myList) { foreach (int item in subList) { Console.WriteLine(item); } } } } }
run
|
edit
|
history
|
help
1
code 1
RRE
check ca a place
linq jean by Fausto
Find 20 business days prior to today's date c#
Area of a field
Creating async methods in C# prior to version 5.0
arrays bidimencionales y tridimencionales
DSXSAXS
30272 Example2