Program.cs ← Example Answer Not Included ❗A dictionary could be seen as a two-dimentional list known as a Key-Value-Pair
Key must be unique in each entry within the dictionary
Filtering a dictionary can be done by using a loop and specifying which Keyor Valuematches given input
public static Dictionary<DateTime, string> FilterByString(string inputfilter, Dictionary<DateTime, string> inputDictionary)
{
Dictionary<DateTime, string> filteredLogs = new Dictionary<DateTime, string>();
foreach(KeyValuePair<DateTime, string> filterTest in inputDictionary)
{
if (filterTest.Value.Contains(inputfilter))
{
filteredLogs.Add(filterTest.Key, filterTest.Value);
Console.WriteLine($"Date: {filterTest.Key.ToShortDateString()}, Log: {filterTest.Value}");
}
}
return filteredLogs;
}