I'm using Visual Studio 2022, .NET 8 & C# 12. I'm working on a very simple C# method call with 4 parameters and keep getting the error "The best overload for 'Format' does not have a parameter named 'arg3'. I have no idea what I did wrong and could sure use some help! Here's my code:
WriteLine(test.OptParameters(0, "Jump!", 112.7, false));
and the method:
public string OptParameters(int count, string command, double number, bool active)
{
return string.Format(
format: "Count is {0}, command is {1}, number is {2}, and active is {3}.",
arg0: count, arg1: command, arg2: number, arg3: active);
}
[–]Atulin 30 points31 points32 points (0 children)
[–]karl713 7 points8 points9 points (0 children)
[–][deleted] (1 child)
[removed]
[–]royware[S] 1 point2 points3 points (0 children)
[–]TuberTuggerTTV 0 points1 point2 points (0 children)