Which keyword defines an extension method in C#?
Correct answer
B. this
20 views
B. this
20 views
In C#, an extension method is a static method in a static class whose first parameter is prefixed with the this keyword, e.g. public static int WordCount(this string s).
Not sure why the answer is B? Ask here and get an explanation.