TargetParameterCountException when enumerating through properties of string

前端 未结 3 1446
梦如初夏
梦如初夏 2021-02-07 09:01

I\'m using the following code to output values of properties:

string output = String.Empty;
string stringy = \"stringy\";
int inty = 4;
Foo spong = new Foo() {Na         


        
3条回答
  •  无人及你
    2021-02-07 09:45

    System.String has an indexed property that returns the char in the specified location. An indexed property needs an argument (index in this case) therefore the exception.

提交回复
热议问题