首页 > 代码库 > 参数数组

参数数组

 
参数数组:关键字params,接受参数,多余的都加到数组中
static void Main(string[] args)
        {
            meas("1","2","3")
        }
        public static void meas(string paramNumber, params string[] arrag)
        {
            for (int i = 0; i < arrag.Length; i++)
            {
                Console.Write(arrag[i]);
            }
            Console.ReadLine();
        }