dri*_*iAn 33
List<String>
Queue<String>
Stack<String>
Run Code Online (Sandbox Code Playgroud)
Pau*_*vre 12
来自MSDN:
using System;
using System.Collections.Generic;
namespace ConsoleApplication1
{
class MSDNSample
{
static void Main()
{
string input = "a b c d";
Stack<string> myStack = new Stack<string>(
input.Split(new string[] { " " }, StringSplitOptions.None));
// Remove the top element (will be d!)
myStack.Pop();
Queue<string> myQueue = new Queue<string>(
input.Split(new string[] { " " }, StringSplitOptions.None));
// Remove the first element (will be a!)
myQueue.Dequeue();
}
}
}
Run Code Online (Sandbox Code Playgroud)
由于我们拥有linq,因此非常容易做到:
string[] array = ...;
array = array.Skip(1).ToArray();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
49917 次 |
最近记录: |