Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,17 @@
static class Program
{
static void Main()
{
System.Collections.Hashtable h = new System.Collections.Hashtable();
string[] keys = { "foo", "bar", "val" };
string[] values = { "little", "miss", "muffet" };
System.Diagnostics.Trace.Assert(keys.Length == values.Length, "Arrays are not same length.");
for (int i = 0; i < keys.Length; i++)
{
h.Add(keys[i], values[i]);
}
}
}

View file

@ -0,0 +1 @@
h[keys[i]] = values[i];

View file

@ -0,0 +1,14 @@
using System.Linq;
static class Program
{
static void Main()
{
string[] keys = { "foo", "bar", "val" };
string[] values = { "little", "miss", "muffet" };
var h = keys
.Zip(values, (k, v) => (k, v))
.ToDictionary(keySelector: kv => kv.k, elementSelector: kv => kv.v);
}
}