Creating methods with infinite parameters?

后端 未结 8 1633
再見小時候
再見小時候 2021-01-31 13:44

In C# you can do this:

foo = string.Format(\"{0} {1} {2} {3} ...\", \"aa\", \"bb\", \"cc\" ...);

This method Format() accepts in

8条回答
  •  太阳男子
    2021-01-31 14:44

     public string Format(params string[] value)
     {
                // implementation
     }
    

    The params keyword is used

提交回复
热议问题