本文转载自  http://www.cnblogs.com/jcdd-4041/p/3279531.html

第一步:先把string[] 转换成 ArrayList  

第二步:移除指定元素

第三步:在转换回string[]

using   System;
using   System.Collections;
 
class   Test
{
    static   void   Main()
    {
        string   []   arr   =   {   "abc1 ",   "abc2 ",   "abc3 ",   };
        ArrayList   al     =   new   ArrayList(arr);
        al.RemoveAt(1);
        arr   =   (string   [])al.ToArray(typeof(string));
        foreach   (string   s   in   arr)
        {
            Console.WriteLine(s);
        }
    }
}

 

相关文章:

  • 2023-03-19
  • 2021-10-16
  • 2022-12-23
  • 2021-12-09
  • 2021-10-16
  • 2021-05-31
  • 2022-12-23
猜你喜欢
  • 2021-10-16
  • 2021-11-07
  • 2021-10-16
  • 2022-12-23
  • 2021-10-16
  • 2023-03-06
相关资源
相似解决方案