Currently Browsing: Microsoft .NET

String extensions – Case-insensitive Replace and Contains

The C# string library is pretty comprehensive, but there are a few methods that were left out. Luckily, in C# 3.0 extensions were introduced, which allows developers to seemingly add methods to existing classes. Remember that extensions only work inside the same namespace, so you’ll have to rename...