Which keyword defines an extension method in C#?
Correct answer
B. this
15 views
B. this
15 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.