using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Diagnostics;
namespace testconsole
{
    class Class1
    {
        static void Main()
        {
            string[] strArrs = new string[] { "1", "1", "1", "7", "6", "4" };
            List<string> listArrs = GetNewArrs(strArrs, "7");
            foreach (string str in listArrs)
            {
                Console.WriteLine(str);
            }            Console.WriteLine("\n\n");
            int index = GetIndex(strArrs, "7");
            string[] strArrs2 = GetNewArrs(strArrs, index);
            foreach (string str in strArrs2)
            {
                Console.WriteLine(str);
            }
            Console.ReadKey();
        }        static List<string> GetNewArrs(string[] strArrs, string strValue)
        {
          
            List<string> strNewArrs = new List<string>();
            bool blFind = false;
            int length = strArrs.Length;
            for (int i = 0; i < length; i++)
            {
                if (strArrs[i].Equals(strValue))
                {
                    blFind = true;
                }
                if (blFind == true)
                {
                    if (i == length - 1)
                    {
                        break;
                    }
                    strNewArrs.Add(strArrs[i+1]);
                }
            }
            return strNewArrs;
        }//只需要遍历一遍数组        #region 方法二
        static int GetIndex(string[] strArrs, string strValue)
        {
            for (int i = 0; i < strArrs.Length; i++)
            {
                if (strArrs[i].Equals(strValue))
                {
                    return ++i;
                }
            }
            return -1;
        }        static string[] GetNewArrs(string[] strArrs, int index)
        {
            int length=strArrs.Length;
            string[] strNewArrs=new string[length-index];
            int i = -1;
            for (; index < length; index++)
            {
                strNewArrs[++i] = strArrs[index];
            }
            return strNewArrs;
        }
        #endregion
    }
}