-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,944
  • 9
  • 57
  • 73
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
  • 60,010
  • 15
  • 145
  • 220
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
  • 71,677
  • 44
  • 195
  • 329