how to take all array elements except last element in C#

后端 未结 6 809
滥情空心
滥情空心 2020-12-14 14:50

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 r

6条回答
  •  醉梦人生
    2020-12-14 15:12

    Microsoft's Reactive Extensions' Team has the Interactive Extensions (NuGet "System.Interactive") that lets you do this:

    var remStrings = queries.SkipLast(1);
    

提交回复
热议问题