Get the first and last item of an array of strings

后端 未结 5 1136
既然无缘
既然无缘 2021-02-05 06:35

If I have the following array of strings:

string[] stringArray = {\"one\", \"two\", \"three\", \"four\"};

Is there a way to get the first and l

5条回答
  •  花落未央
    2021-02-05 07:22

    string[] stringArray = { "one", "two", "three", "four" };
    var last=stringArray.Last();
    var first=stringArray.First();
    

提交回复
热议问题