-3

Well, I need to subtract the number from a string, and in the end she should continue being a string ...

I try:

PStruct.character[Index, PStruct.player[Index].SelectedChar].Y = 
  (Convert.ToInt32(PStruct.character[Index, PStruct.player[Index].SelectedChar].Y) - 1)
 .ToString;

Character.Y is a string.

The error: Cannot convert method group "ToString" to non-delegate type "string".

Anyone have tips or a solution?

Richard Schneider
  • 34,169
  • 9
  • 55
  • 69
user3571412
  • 105
  • 1
  • 9

2 Answers2

2

Use parenthesis to invoke/call a method:

expr.ToString()

Without parenthesis it (ToString) is treated as a "method group", which is useful in some cases - but not here.

Community
  • 1
  • 1
user2864740
  • 57,407
  • 13
  • 129
  • 202
0

As written, you are trying to treat a function ToString as a type string.

As the comment mentioned, you probably meant to write ToString().

merlin2011
  • 67,488
  • 40
  • 178
  • 299