Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Collections demo
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { // Generic IList<int> list = new List<int>(); list.Add(1); Console.WriteLine(list[0]); ICollection<int> collection = new List<int>(); collection.Add(2); collection.Add(3); //Console.WriteLine(collection[0]); //Does not work! foreach (int collectioni in collection) { Console.WriteLine(collectioni); } IEnumerable<int> enumerable = new List<int>() {4,5}; //enumerable.Add(6); // Does not work foreach (int enumerablei in enumerable) { Console.WriteLine(enumerablei); } } } }
run
|
edit
|
history
|
help
0
first index of a substring in a given string
ray's 2nd test
Array value changer?
Unix timestamp to DateTime
For - box
miner
30272 ProgramEX8 For&While
Prime
Uninitialized-variable example.
c# abstract