Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. int[] copyArray = myArray.ToArray();
  2.  
  3. int[] sortedCopy = from element in copyArray
  4. orderby element ascending select element;
  5.  
  6. int[] sortedCopy = (from element in myArray orderby element ascending select element)
  7. .ToArray();
  8.  
  9. int[] sortedCopy = myArray.OrderBy(i => i).ToArray();
  10.  
  11. Array.Sort(myArray);
  12.  
  13. Array.Sort(entityArray, (x,y) => string.Compare(x.Name, y.Name));
  14.  
  15. var sortedCopy = entityArray.OrderBy(x => x.Name).ToArray();
  16.  
  17. var sortedCopy = myArray.OrderBy(i => i);
  18.  
  19. foreach(var item in sortedCopy)
  20. {
  21. //print out for example
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement