How to create an extension method on a class in C#?
-
07-07-2019 - |
Question
I'd like to write an extension method for string, which appears as a static method on System.String - I've not managed to get that done.
Is that possible? If so how? Thanks!
Solution
It's not possible. Extension methods let you add what look like instance methods, and not static methods.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow