I'm fairly new to C#, and trying to figure out string insertions (i.e. "some {0} string", toInsert
), and ran across a problem I wasn't expecting...
In the case where you have two constructors:
public MyClass(String arg1) { ... }
public MyClass(String arg1, String arg2) { ... }
Is it possible for me to use the first constructor with a string insertion?
...
toInsert = "def"
myClass = new MyClass("abc{0}ghi", toInsert)
...
Or will C# interpret this as the second constructor and pass a literal "abc{0}ghi"
as the first argument?