Monday, June 23, 2014

[ StackOverflow ] - Use ListForEach to add element to HashTable

c# - Use ListForEach to add element to HashTable - Stack Overflow
Try this:
valueList.ForEach(x => htable.Add(valueList.FindIndex(y => y == x), x));
Although, there's really no reason not to use a for here
for(var index =0; index < valueList.Count; index++){
    htable.Add(index, valueList[index]);}

No comments:

Know us

Our Team

Tags

Video of the Day

Contact us

Name

Email *

Message *