Tagged in

Extension Method

theburningmonk.com
theburningmonk.com
the personal blog for Yan Cui
More information
Followers
923
Elsewhere
More, on Medium

Extension methods to sum IEnumerable(ulong) and IEnumerable(ulong?)

Ever tried to use IEnumerable<T>.Sum on an array of unsigned long integers? Well, you can’t, because the Sum method has not been implemented for ulong or ulong?, so to fill in the gap here’s the extension methods…


C# Extension method for checking attributes

Another good question on StackOverflow, and even better answer from Steven (miles better than what I managed!), the question was around how to implement an extension method to check whether a certain method has a particular attribute applied to it…


.Net Tips — String.ToTitleCase() extension methods

As you most likely know already, there are ToLower() and ToUpper() methods on the String class in C#, but a method to convert a string to ‘Title Case’ is sadly missing.