You probably knew that you can use the String.Trim method to remove whitespace from the start and end of a C# string. Unfortunately, the Trim method does not remove whitespace from the middle of a string.
If you need a collection of objects accessed by a key, and the key is one of the object’s properties, then you should use the KeyedCollection class instead of Dictionary. For example, you would use a KeyedCollection to store Employee objects accessed by the employee’s ID property.
Recently I posted a list of the Best C# Blogs. Today we recognize the best C# Web sites.
Following (in alphabetical order) are the best C# sites active on the Web today. Also included is the “About” section of the site (edited for space and clarity). Please comment if you can recommend other excellent C# web sites that didn’t make my list.
What makes a C# blog good? Pretty much the same thing that makes any blog good, but with a focus on C#, of course. Good C# blogs have:
- Useful news, information, tips and code samples
- Regular updates
- Original content, not a splog or news feed
- Good organization, including categories and tags
- Healthy discussion and user comments
- Personal insight and humor, but not too much personal drivel