LoginSignup
1
1

More than 5 years have passed since last update.

Console.WriteLineのオーバーロード

Posted at

戒めのためにメモ。

Console.WriteLine()のオーバーロードの中には、引数の中に format 付きの物があったのですね。

Console.WriteLine(string format, object arg0)
Console.WriteLine(string format, object arg0, object arg1)
Console.WriteLine(string format, object arg0, object arg1, object arg2)
Console.WriteLine(string format, object arg0, object arg1, object arg2, object arg3)
Console.WriteLine(string format, params object[] arg)

いままでこんなかんじで書いてましたが、String.Format() とか不要だったとは!

//どちらも同じ結果
//Console.WriteLine(String.Format("Sum={0}",Sum(1,2,3,4,5)));
Console.WriteLine("Sum={0}",Sum(1,2,3,4,5));
1
1
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
1
1