Loop 2 arrays and check if equal values and update data C# -
i have 1 array max 2 ids of pictures null or 1 id on server side.
second array coming client side , can have 2, 1 or 0 elements.
now need check if id client side in array on server side , if yes delete old 1 , replace new.
example:
oldid(1 , 2) newid(2 , 3) if ([2] != [1] && [2] != [2]) { //ignore replacing oldid array } if ([3] != [1] && [3] != [2]) { //replace array }
so @ end should have array(3 , 2)
thank you.
according example:
foreach(var item in clientarray) { if(!serverarray.contains(item)) { // } }
but sentence (above example) says opposite.
Comments
Post a Comment