Wednesday, October 28, 2009

Clone a generic list


Never thought it would be this easy..

List> insideSpans = replacingDic.Where(d => d.Key.Contains("
List> insideSpansClone = new List>(insideSpans.Count);


insideSpans.ForEach((cloneitem) =>
{
insideSpansClone.Add(new KeyValuePair(cloneitem.Key, cloneitem.Value));
});