Loop 2 arrays and check if equal values and update data C# -


  1. i have 1 array max 2 ids of pictures null or 1 id on server side.

  2. 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

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -