I have a string array like this.
string[] queries with data more than one string.
I want to skip the last string from the element and take the remaining. I have come up with
var remStrings = queries.Reverse().Skip(1).Take(queries.Length - 1);
Is there a better alternative to this?
No need to Reverse and Skip. Just take one less element than there are in the array.
If you really wanted the elements in the reverse order, you could tack on a
.Reverse()to the end.