.NET ez 2012-06-20
使用C#在Function接收多個參數,可以使用params string[] args,就可以接收多個string了。
namespace Test { class Program { static void Main(string[] args) { Fun1("a"); Fun2("a", "b", "c", "d", "e"); } //接收一個參數 static void Fun1(string arg1) { } //接收多個參數 static void Fun2(params string[] args) { } } }
標籤: .NET
本文章網址:
https://www.ez2o.com/Blog/Post/csharp-Function-Params-String
https://www.ez2o.com/Blog/Post/74
https://www.ez2o.com/Blog/Post/csharp-Function-Params-String
https://www.ez2o.com/Blog/Post/74