I am learning C #, and there is something that I don’t understand, that I could not find any help on the Internet.
string[] = testarray = { "test1", "test2", "test3" };
teststring = teststring.Join(" ", testarray);
The following error message failed:
Member 'string.Join (string, params string [])' cannot be accessed with reference to the instance; qualify it instead of the type name.
However, it works if I change to:
teststring = string.Join(" ", testarray);
If I however use the Split function, as in:
teststring = teststring.Split(new char[] {' '});
I no longer receive the error message. I suppose this has something to do with certain functions of the string class, which are static and some are not, but how can I determine which function is static and which is not? (if this is the reason)
/ - , .