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
You can look at MSDN's documentation for the String class for a list of all available methods. Static methods have an orange "S" icon next to them, while instance methods do not, e.g.:
When thinking about the difference between static and instance methods, think about whether the functionality of that method depends on a particular instance of the class.
If the answer is yes, then it's likely to be implemented as an instance method; and if not, it's likely to be a static method.
For example, the Split
method separates a specific instance of the String
class (the string from which it is called) into an array.
In contrast, the Join
method is like a utility method, which can be called upon to combine an array separated by a string -- without first creating an instance of the String
class in order to call it.