Sajo
Member
- Joined
- Jul 22, 2020
- Messages
- 17
- Programming Experience
- Beginner
Hello. I read somewhere that before using foreach loop for list elements it is necessary to use the List.Sort method to sort them before using foreach. For example, to print the elements of a list, we need to use this method first, and then the foreach cycle. My question is: why do we have to use the sort method before applying the foreach cycle to list elements and why I should sort elements in my list?