I generally use a foreach loop to iterate through Dictionary.
Dictionary dictSummary = new Dictionary(); <
Dictionary dictSummary = new Dictionary();
You don't need to use .ToArray() or .ElementAt(). It is as simple as accessing the dictionary with the key:
.ToArray()
.ElementAt()
dictSummary.Keys.ToList().ForEach(k => dictSummary[k] = dictSummary[k].Trim());