LoginSignup
15
14

More than 5 years have passed since last update.

C# 可変長引数

Last updated at Posted at 2014-08-08

こんな方法があるなんて
全然知りませんでした。

class aaa {
        static void bbb (int a ,params string[] strs) {
        }
    }

    static void Main () {
        int a = 1;
        int b = 2;
        bbb(a,"foo","bar","baz");
        bbb(b);
    }
}
15
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
14