Why do I get “cannot be accessed with an instance reference” when using teststring.Join but not teststring.Split? (c#)

前端 未结 6 502
南旧
南旧 2021-01-18 11:44

I\'m learning c# and there is something I do not understand that I\'ve been unable to find any help about online.

string[] = testarray = { \"test1\", \"test2         


        
6条回答
  •  独厮守ぢ
    2021-01-18 12:14

    Join is a static method on the String class, whereas Split is an instance method. To find out which is which, right click on String and Go To Definintion. This will show you the definition of the class (with method declarations, etc.)

提交回复
热议问题