Chris Pietschmann

husband, father, hacker, entrepreneur, futurist, innovator, autodidact

NAVIGATION - SEARCH

dotNetExt - .NET Extension Method Library - v0.1 Beta Released

This is the first release of a small, new project I created. This is just the first release of the project, and I'll keep adding more functionality to it if there is enough interest by me or others in the project. So, please post any comments you have in the project discussion area.

dotNetExt - .NET Extension Method Library

dotNetExt is a small Extension Method Library for .NET 3.5 that extends the BCL Types with helper methods that make simple tasks simpler. So far there are extensions for the Object, Array and String BCL Types. The library is flexible so you can Import All Extension Methods or just the Extension Methods for the BCL Type you want.

Download Here: http://codeplex.com/dotNetExt

Library Usage

You can include the entire library of Extension Methods by Importing the dotNetExt namespace. Alternatively you can Import just the Extension Methods you want (grouped by Base Class Library Type) by including that specific extension collections namespace.

// Include All Extension Methods
using dotNetExt;

// Include Only The Array Extension Methods
using dotNetExt.Array;

// Include Only The Object Extension Methods
using dotNetExt.Object;

// Include Only The String Extension Methods
using dotNetExt.String;

Extension Methods

dotNetExt namespace

Importing this namespace you will import all the Extension Methods from the below namespaces.

dotNetExt.Array namespace

This namespace includes Extension Methods for the System.Array Type only.

  • IsEmpty() - Returns a Boolean indicating whether the Array is Empty (is Null or has a length of zero).

dotNetExt.Object namespace

This namespace includes Extension Methods for the System.Object Type only.

  • IsType() - Returns a Boolean value indicating whether a variable is of the indicated Type
  • IsArray() - Returns a Boolean value indicating whether a variable points to a System.Array.
  • IsDate() - Returns a Boolean value indicating whether a variable points to a DateTime object.
  • IsDBNull() - Returns a Boolean value indicating whether an expression evaluates to the DBNull class.

dotNetExt.String namespace

This namespace includes Extension Methods for the System.String Type only.

  • Left() - Returns a string containing a specified number of characters from the left side of a string.
  • Right() - Returns a string containing a specified number of characters from the right side of a string.
  • EncodeHtml() - Returns the String HtmlEncoded.
  • DecodeHtml() - Returns the String HtmlDecoded.
  • EncodeUrl() - Returns the String UrlEncoded.
  • DecodeUrl() - Returns the String UrlDecoded.
  • EncodeBase64() - Returns the String Base64 Encoded.
  • DecodeBase64() - Returns the String Base64 Decoded.
  • ToByteArray() - Returns a Byte Array of the String.
blog comments powered by Disqus