Answers for "c# nested list"

C#
1

c# nested list

using System;
using System.Collections;
using System.Collections.Generic;

//^^^ Needed libraries

List<List<type>> name = new List<List<type>>
{
	new List<type> {"Hi", "How are you?"},
    new List<type> {"Hope this was helpful"}
};
Posted by: Guest on November-23-2020
0

c# nested list

using System;
using System.Collections.Generic;

namespace main {
	class Program {
    	private static void Main(string[] args) {
        	// syntax: List<type> name = new List<type>();
            List<int> integerList = new List<int>();
            for (int i = 0; i < 10; i++) {
                // add item to list
            	integerList.Add(i);
            }
            for (int i = 0; i < 10; i++) {
                // print list item
            	Console.WriteLine(integerList[i]);
            }
        }
    }
}
Posted by: Guest on July-12-2021

C# Answers by Framework

Browse Popular Code Answers by Language