I have a need to move an item in an IEnumerable<> up, that is move one item above another. What is the simplest way to do this?
A similar question was asked here but I don’t have a generic list only an IEnumerable<>: Generic List – moving an item within the list
As @Brian commented the question is a little unclear as to what
move an item in an IEnumerable<> upmeans.If you want to reorder an IEnumerable for a single item then the code below should might be what you are looking for.