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

前端 未结 6 469
南旧
南旧 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 11:58

    This is because Join is a static method on string. static methods are always called using the class name, not the name of a variable for an instance of that class.

提交回复
热议问题