Skip to content
Loading
How to retrieve Distinct strings from comparing two Arrays?
  • Ravi Sangtani
    Hi! try this one
    1. bool isfound = false;  
    2. for (int i = 0; i < allstd.Length; i++)  
    3. {  
    4. isfound = false;  
    5. for (int j = 0; j < present.Length; j++)  
    6. {  
    7. if (allstd[i] == present[j])  
    8. {  
    9. isfound = true;  
    10. break;  
    11. }  
    12. }  
    13. if (!isfound)  
    14. {  
    15. MessageBox.Show(allstd[i]);  
    16. }  
    17. }  
    +1