c# - How to remove duplicates form string array -
i have string array contains json strings . possible identify , remove records contains same uid ?
{"object":"user","entry":[{"uid":"823602904340066","id":"823602904340066","time":1429276535,"changed_fields":["feed"]}]} {"object":"user","entry":[{"uid":"10203227586595390","id":"10203227586595390","time":1429278537,"changed_fields":["feed"]}]} {"object":"user","entry":[{"uid":"10203227586595390","id":"10203227586595390","time":1429278531,"changed_fields":["feed"]}]}
a single item unique, duplication occurs in multiple items. so, first of convert data list
// convert list, add values list<myobject> array = jsonconvert.deserializeobject<list><myobject>>(json); // distinct items.. // use .tolist() convert list. array = array.distinct().tolist();
this above code first convert json list of objects. select distinct items after save non duplicate list actual list. can add condition distinct method using lambda expression.