Guest User

Untitled

a guest
Jul 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public int isSocialNetworkPresent(ArrayList socialVal, String socialNet_name)
  2. {
  3. int id = -1;
  4. int indexArraylist = 0;
  5. bool found = false;
  6. foreach (SocialElement element in socialVal)
  7. {
  8.  
  9. String socialName = element.getSocialName();
  10. if ((socialName.Equals(socialNet_name)))
  11. {
  12. found = true;
  13. break;
  14. }
  15. else { indexArraylist++; }
  16. }
  17. if (found)
  18. {
  19. return indexArraylist;
  20. }
  21. else
  22. {
  23. return id;
  24. }
  25.  
  26.  
  27. }
Add Comment
Please, Sign In to add comment