演示的代码:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
List<string> list = new List<string>(5);
list.Add("BOB");
list.Add("TOM");
list.Add("Jerry");
list.Add("MOB");
var objectArray = list.ToArray();
string[] stringArray = new string[list.Count];
list.CopyTo(stringArray, 0); // 将list复制到