SoFunction
Updated on 2025-03-07

How to use Params in C#


using System;
namespace Params
{
    class Program
    {
        static void Main(string[] args)
        {
            PrintMany("Hello", "World");
        }
 
        static void PrintMany(params object[] allParams)
        {
            if(allParams != null)
            {
                foreach(var p in allParams)
                {
                    (p);
                }
            }
 
            ();
        }
    }
}