development:csharp:lists_and_dictionaries

no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


development:csharp:lists_and_dictionaries [2021/05/27 13:53] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== C# lists and dictionaries ======
 +<code c#>
 +// List
 +List<string> list = new();
 +list.add("alpha");
 +list.add("beta");
 +if (list.Contains("alpha")) { }
 +list.ForEach(delegate(String val)
 +{
 +    val;
 +});
 +list.Remove("alpha");
  
 +// Dictionary
 +Dictionary<string, UInt16> dict = new();
 +dict["alpha"] = 1;
 +dict["beta"] = 2;
 +if (dict.ContainsKey("alpha")) { }
 +foreach (KeyValuePair<string, UInt16> entry in [dictionary])
 +
 +    entry.Key;
 +    entry.Value;
 +}
 +dict.Remove("alpha");
 +</code>
  • development/csharp/lists_and_dictionaries.txt
  • Last modified: 2021/05/27 13:53
  • by 127.0.0.1