“Expected class, delegate, enum, interface or struct” error on public static string MyFunc(). What's an alternative to “string”?

前端 未结 3 1297
忘了有多久
忘了有多久 2021-01-04 10:23

I\'m getting an error when I attempt to use the following static function.

Error:

Expected class, delegate, enum, interface, or struct

3条回答
  •  长情又很酷
    2021-01-04 10:45

    You need to put the method definition into a class/struct definition. Method definitions can't appear outside those.

提交回复
热议问题