This project contains several useful productivity-increasing tidbits.

NEW usage examples are available:
CollectionExtensions.cs
StringExtensions.cs

ArrayUtilities.cs

  • Combine<T>
    • Combines a series of arrays of the same type into a single array.

ByteArrayExtensions.cs

  • BinaryDeserialize
    • Deserializes a binary array.
  • ByteArrayToString
    • Converts a byte array to a string.
  • Compress
    • Compresses a byte array using gzip compression.
  • Decompress
    • Decompresses a byte array using gzip compression.
  • ToImage
    • Converts a byte array to an image.
  • Trim
    • Trims the length of a byte array.
  • ToFile
    • Writes a byte array to a file.

CollectionExtensions.cs

  • AddRange<T>
    • Adds a range of values to an existing List.
  • Average
    • Averages the values of an integer array.
  • Combine<T>
    • Combines the source array with any number of other arrays of the same type.
  • ContainsAtLeast<T>
    • Checks whether an IEnumerable contains at least a certain number of items.
  • ForEach<T>
    • Iterates each item in an IEnumerable of a type and performs an operation.
  • GroupEvery<T>
    • Creates an array of IEnumerables grouped.
  • IndexOf<T>
    • Returns the index of the first occurrence of a value in a sequence by using the default EqualityComparer.
  • IndexOf<T>
    • Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer.
  • IndexOf<T>
    • Returns the index of the first occurrence, starting at the indicated start index, in a sequence by using the default equality comparer.
  • IndexOf<T>
    • Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer.
  • IndexOfNextContaining
    • Retrieves the index of the next line in a string list that contains the specified value.
  • IndexOfPrevious<T>
    • Retrieves the index of the previous line in a string list that contains the specified value.
  • IndexOfPreviousContaining
    • Retrieves the index of the previous line in a string list that contains the specified value.
  • IsNullOrEmpty
    • Returns a Boolean indicating whether the Array is null or empty.
  • IsNullOrEmpty
    • Returns a Boolean indicating whether the ArrayList is null or empty..
  • Pop<T>
    • Gets the last value from a list.
  • Push<T>
    • Adds a value to the end of a list.
  • RemoveDuplicates<T>
    • Removes duplicate strings from an array.
  • Slice<T>
    • Get the array slice between the two indexes. Inclusive for start index, exclusive for end index.
  • ToDataSet<T>
    • Converts and IEnumerable to a DataSet.
  • ToDataTable<T>
    • Converts and IEnumerable to a DataTable.
  • WhereIn<TElement,TValue>
    • Returns the element that the specified property's value is contained in the specifiec values.
  • WhereIn<TElement,TValue>
    • Returns the element that the specified property's value is contained in the specifiec values.
  • WhereNotIn<TElement,TValue>
    • Returns the element that the specified property's value is not contained in the specifiec values.
  • WhereNotIn<TElement,TValue>
    • Returns the element that the specified property's value is not contained in the specifiec values.

DataRowExtensions.cs

  • GetBooleanValue
    • Returns the Boolean value of the specified column.
  • GetBooleanValue
    • Returns the Boolean value of the specified column. If the value is null, the supplied value is used.
  • GetByteValue
    • Returns the Byte value of the specified column.
  • GetByteValue
    • Returns the Byte value of the specified column. If the value is null, the supplied value is used.
  • GetDateTimeValue
    • Returns the DateTime value of the specified column.
  • GetDateTimeValue
    • Returns the DateTime value of the specified column. If the value is null, the supplied value is used.
  • GetDecimalValue
    • Returns the Decimal value of the specified column.
  • GetDecimalValue
    • Returns the Decimal value of the specified column. If the value is null, the supplied value is used.
  • GetInt32Value
    • Returns the Integer value of the specified column.
  • GetInt32Value
    • Returns the Integer value of the specified column. If the value is null, the supplied value is used.
  • GetInt64Value
    • Returns the Long value of the specified column.
  • GetInt64Value
    • Returns the Long value of the specified column. If the value is null, the supplied value is used.
  • GetInt16Value
    • Returns the Short value of the specified column.
  • GetInt16Value
    • Returns the Short value of the specified column. If the value is null, the supplied value is used.
  • GetStringValue
    • Returns the String value of the specified column.
  • GetStringValue
    • Returns the String value of the specified column. If the value is null, the supplied value is used.

DataSetExtensions.cs

  • HasData
    • Determines whether the DataSet has data.

DataTableExtensions.cs

  • AddColumn
    • Creates and adds a System.Data.DataColumn object to the System.Data.DataColumnCollection.

DataUtilities.cs

  • FillDataRow<T>
    • Contains various data-related utilities.
  • CreateDataTable<T>
    • Contains various data-related utilities.

DateTimeExtensions.cs

  • AddMonth
    • Adds one month to the specified date.
  • AddWeek
    • Adds one week to the specified DateTime value.
  • AddWeeks
    • Adds the specified number of weeks to the specified DateTime value.
  • Age
    • Gets the age of the DateTime value. If the specified value is after the current date, the method will return 0.
  • Age2
    • Gets the age of the DateTime value. If the specified value is after the current date, the method will return a negative number.
  • DaysSince
    • Gets the number of days since the specified date.
  • DifferenceFrom
    • Gets the difference between two dates by using the specified interval unit.
  • EndOfDay
    • Gets a DateTime representing 23:59:59 on the specified date.
  • FirstCalendarDayOfCurrentFiscalYear
    • Gets a DateTime object representing the first calendar day in the fiscal year for the specified date.
  • FirstCalendarDayOfPreviousFiscalYear
    • Gets a DateTime object representing the first calendar day in the previous fiscal year for the specified date.
  • FirstDayOfCurrentQuarter
    • Gets the first day of the current quarter.
  • FirstDayOfMonth
    • Gets the first day in the month for the given date.
  • FirstDayOfMonth
    • Gets the first instance of the specified day in the specified month.
  • FirstDayOfPreviousQuarter
    • Gets the first day of the previous quarter.
  • FirstDayOfWeek
    • Gets the first day of the week (Sunday) for the given date.
  • FirstWorkDayOfCurrentFiscalYear
    • Gets a DateTime object representing the first work day in the fiscal year for the specified date.
  • FirstWorkDayOfPreviousFiscalYear
    • Gets a DateTime object representing the first work day in the previous fiscal year for the specified date.
  • FiscalYear
    • Gets the government's fiscal year for the specified date.
  • FormatDateTime
    • Attempts the supplied date/time string value.
  • FractionalHoursToString
    • Converts a fractional hour value like 1.25 to 1:15 hours:minutes format
  • FractionalHoursToString
    • Converts a fractional hour value to the specified format
  • IsLeapYear
    • Determines whether the specified DateTime is in a leap year.
  • IsWeekDay
    • Returns whether the DateTime falls on a weekday.
  • IsWeekend
    • Lets you easily figure out if value of this instance a date value that is a weekend.
  • JulianDate
    • Gets the julian date (as defined by DOD) for the specified date value.
  • LastCalendarDayOfCurrentFiscalYear
    • Gets a DateTime object representing the first calendar day in the fiscal year for the specified date.
  • LastCalendarDayOfPreviousFiscalYear
    • Gets a DateTime object representing the first calendar day in the previous fiscal year for the specified date.
  • LastDayOfMonth
    • Gets the last day in the month for the given date.
  • LastDayOfMonth
    • Gets the last specified day of the week in the month for the given date.
  • LastDayOfPreviousQuarter
    • Gets the last day of the previous government's fiscal quarter.
  • LastDayOfWeek
    • Gets the DateTime that represents the last day of the week (Saturday) for the given date.
  • LastWorkDayOfCurrentFiscalYear
    • Gets a DateTime object representing the first work day in the fiscal year for the specified date.
  • LastWorkDayOfPreviousFiscalYear
    • Gets a DateTime object representing the first work day in the previous fiscal year for the specified date.
  • Midnight
    • Gets a DateTime representing midnight on the specified date.
  • NextDayOfMonth
    • Gets the first date following the specified date which falls on the specified day of the week.
  • Noon
    • Gets a DateTime representing noon on the specified date.
  • SetTime
    • Sets the time of the specified date with hour precision.
  • SetTime
    • Sets the time of the specified date with minute precision.
  • SetTime
    • Sets the time of the specified date with second precision.
  • SetTime
    • Sets the time of the specified date with millisecond precision.
  • StartOfDay
    • Returns a new DateTime representing the exact start of the day for the specified instance.
  • SubtractDays
    • Subtracts the specified number of days from the value of this instance.
  • SubtractMonth
    • Subtracts one month from the specified date.
  • SubtractWeek
    • Subtracts one week from the specified DateTime value.
  • SubtractWeeks
    • Subtracts the specified number of weeks from the specified DateTime value.
  • ToAgoString
    • Formats past dates in a more user friendly way. For example, "12 hours ago".
  • ToDODString
    • Formats the specified date as a properly DOD formatted String.
  • ToFriendlyString
    • Represents dates in a more user friendly way.
  • ToHour
    • Gets a DateTime that represents the current hour.
  • ToRFC822DateString
    • Converts a regular DateTime to a RFC822 date string.
  • ToUntilString
    • Formats a friendly string indicating the amound of time until a date.
  • Weeks
    • Provides an easy way to navigate weeks, e.g. 3.Weeks().Ago.
  • Years
    • Provides an easy way to navigate years, e.g. 5.Years().FromNow.
  • Days
    • Provides an easy way to navigate days, e.g. 19.Days().From(myDate).
  • AgoSince
    • Determines time in past from a date.
  • From
    • Determines a time in the future.

DateTimeUtilities.cs

  • GetQuarter
    • Retrieves the quarter the specified month resides in.
  • GetStartOfQuarter
    • Gets the start of the specified quarter.
  • GetEndOfQuarter
    • Gets the end of the specified quarter.
  • GetQuarter
    • Gets the quarter the specified month resides in.
  • GetEndOfLastQuarter
    • Gets the end of the last quarter.
  • GetStartOfLastQuarter
    • Gets the start of the last quarter.
  • GetStartOfCurrentQuarter
    • Gets the start of the current quarter.
  • GetEndOfCurrentQuarter
    • Gets the end of the current quarter.
  • GetStartOfLastWeek
    • Gets the start of the last week.
  • GetEndOfLastWeek
    • Gets the end of the last week.
  • GetStartOfCurrentWeek
    • Gets the start of the current week.
  • GetEndOfCurrentWeek
    • Gets the end of the current week.
  • GetStartOfMonth
    • Gets the start of the specified month.
  • GetEndOfMonth
    • Gets the end of the specified month.
  • GetStartOfYear
    • Returns a date representing the start of the year.
  • GetEndOfYear
    • Returns a date representing the end of the year.
  • GetStartOfLastYear
    • Gets the start of last year.
  • GetEndOfLastYear
    • Returns a date representing the end of last year.
  • GetStartOfCurrentYear
    • Returns a date representing the start of the current year.
  • GetEndOfCurrentYear
    • Returns a date representing the end of the current year.

DropDownListExtensions.cs

  • AddBlankItem
    • Adds a blank item to the list.
  • AddItem
    • Adds an item to the list.
  • SelectItem
    • Selects a DropDownList item. If the selected item isn't found by value, it will attempt to select the item by its text.

IDataReaderExtensions.cs

  • GetBooleanValue
    • Gets the value of the specified column (by name) as a Boolean.
  • GetBooleanValue
    • Gets the value of the specified column (by name) as a Boolean. If the value is null, the supplied value is used.
  • GetBooleanValue
    • Gets the value of the specified column (by index) as a Boolean.
  • GetBooleanValue
    • Gets the value of the specified column (by index) as a Boolean. If the value is null, the supplied value is used.
  • GetByteValue
    • Gets the value of the specified column (by name) as a byte.
  • GetByteValue
    • Gets the value of the specified column (by name) as a byte. If the value is null, the supplied value is used.
  • GetByteValue
    • Gets the value of the specified column (by index) as a byte.
  • GetByteValue
    • Gets the value of the specified column (by index) as a byte. If the value is null, the supplied value is used.
  • GetDateTimeValue
    • Gets the value of the specified column (by name) as a DateTime object.
  • GetDateTimeValue
    • Gets the value of the specified column (by index) as a DateTime object.
  • GetDateTimeValue
    • Gets the value of the specified column (by index) as a DateTime object.
  • GetDateTimeValue
    • Gets the value of the specified column (by name) as a DateTime object. If the value is null, the supplied value is used.
  • GetDecimalValue
    • Gets the value of the specified column (by name) as a Decimal object.
  • GetDecimalValue
    • Gets the value of the specified column (by name) as a Decimal object. If the value is null, the supplied value is used.
  • GetDecimalValue
    • Gets the value of the specified column (by index) as a Decimal object.
  • GetDecimalValue
    • Gets the value of the specified column (by index) as a Decimal object. If the value is null, the supplied value is used.
  • GetDoubleValue
    • Gets the value of the specified column (by name) as a double-precision floating point number.
  • GetDoubleValue
    • Gets the value of the specified column (by name) as a double-precision floating point number. If the value is null, the supplied value is used.
  • GetDoubleValue
    • Gets the value of the specified column (by index) as a double-precision floating point number.
  • GetDoubleValue
    • Gets the value of the specified column (by index) as a double-precision floating point number. If the value is null, the supplied value is used.
  • GetInt16Value
    • Gets the value of the specified column (by name) as a 16-bit signed integer.
  • GetInt16Value
    • Gets the value of the specified column (by name) as a 16-bit signed integer. If the value is null, the supplied value is used.
  • GetInt16Value
    • Gets the value of the specified column (by index) as a 16-bit signed integer.
  • GetInt16Value
    • Gets the value of the specified column (by index) as a 16-bit signed integer. If the value is null, the supplied value is used.
  • GetInt32Value
    • Gets the value of the specified column (by name) as a 32-bit signed integer.
  • GetInt32Value
    • Gets the value of the specified column (by name) as a 32-bit signed integer. If the value is null, the supplied value is used.
  • GetInt32Value
    • Gets the value of the specified column (by index) as a 32-bit signed integer.
  • GetInt32Value
    • Gets the value of the specified column (by index) as a 32-bit signed integer. If the value is null, the supplied value is used.
  • GetInt64Value
    • Gets the value of the specified column (by name) as a 64-bit signed integer.
  • GetInt64Value
    • Gets the value of the specified column (by name) as a 64-bit signed integer. If the value is null, the supplied value is used.
  • GetInt64Value
    • Gets the value of the specified column (by index) as a 64-bit signed integer.
  • GetInt64Value
    • Gets the value of the specified column (by index) as a 64-bit signed integer. If the value is null, the supplied value is used.
  • GetStringValue
    • Gets the value of the specified column (by name) as a string.
  • GetStringValue
    • Gets the value of the specified column (by name) as a string. If the value is null, the supplied value is used.
  • GetStringValue
    • Gets the value of the specified column (by index) as a string.
  • GetStringValue
    • Gets the value of the specified column (by index) as a string. If the value is null, the supplied value is used.
  • GetValue
    • Gets the value of the specified column (by name) in its native format. If the value is null, the supplied value is used.
  • GetValue
    • Gets the value of the specified column (by index) in its native format. If the value is null, the supplied value is used.

ImageExtensions.cs

  • AppendBorder
    • Appends a border to an existing image.
  • Brightness
    • Modifies the brightness of an image.
  • Color
    • Colorizes an image.
  • Contrast
    • Sets the contrast of an image.
  • Copy
    • Creates a copy of a bitmap.
  • Crop
    • Crops an image file.
  • Gamma
    • Adjusts the gamma of an image.
  • GrayScale
    • Sets an image to grayscale.
  • Invert
    • Inverts an image.
  • IsGrayscale
    • Check if the image is grayscale.
  • Resize
    • Resizes a bitmap.
  • Resize
    • Resizes an image and creates a copy under the new filename.
  • ResizeToHeight
    • Resizes an image to a particular height.
  • ResizeToWidth
    • Resizes an image file to a particular width.
  • ResizeWithTransparency
    • Resizes an image and creates a copy under the new filename.
  • ToByteArray
    • Converts an image to a byte array.
  • ToByteArray
    • Converts an image to a byte array in the specified format.
  • ToTransparentThumbnail
    • Returns a thumbnail of a transparent image.

IOExtensions.cs

  • AddToRecentDocuments
    • Adds a file to the Recent Documents menu using the Shell.
  • AppendTextFile
    • Appends text to a file.
  • CreateTextFile
    • Creates a new text file from a string.
  • DeleteToRecycleBin
    • Deletes the file or directory to the recycle bin using the Shell.
  • DeleteToRecycleBin
    • Deletes a file or directory to the recycle bin using the Shell. Optional confirmation dialog.
  • IsMediaFile
    • Determines if file is video or image file based upon its extension.
  • FileSizeFormatted
    • Formats the integer length of a file to a more friendly string, e.g. "1GB", "50 bytes", etc.,
  • FileSizeFormatted
    • Formats the long length of a file to a more friendly string, e.g. "1GB", "50 bytes", etc.,
  • FileSizeFormatted
    • Formats the length value of the specified FileInfo object to a more friendly string, e.g. "1GB", "50 bytes", etc.,
  • Lines
    • Gets a list of all the lines in a text file.
  • MimeType
    • Retrieves the mime type of a file.
  • SearchByExtension
    • Searches files based upon their extension.
  • SearchByExtensions
    • Searches files based upon an extension list.
  • SearchByName
    • Searches files based upon their file name.
  • ShowInWindowsExplorer
    • Displays a folder in Windows Explorer.
  • ShowInWindowsExplorer
    • Displays a file in Windows Explorer.
  • Thumbnail
    • Retrieves a thumbnail for the specified file.
  • ToByteArray
    • Gets a byte array from a file stream.
  • ToByteArray
    • Gets a byte array from a file.
  • ToImage
    • Attempts to retrieve the specified file into an Image.

ListControlExtensions.cs

  • AddItem
    • Adds a new item to the ListControl.
  • AddItem
    • Adds a new item to the ListControl and optionally allows for the item to be immediately selected.
  • SortByText
    • Sorts the ListControl by its Text property.
  • SortByValue
    • Sorts the ListControl by its Value property.
  • ToArray
    • Gets a string array representing the values from the checked items in the ListControl.

NavigationServiceExtensions.cs

  • RemoveAllBackEntries
    • Removes all back entries from a NavigationService.

NetworkingExtensions.cs

  • SendToComputer
    • Sends a file to a remote computer using sockets. Requires a waiting server at the specified IP and port.

NetworkingUtilities.cs

  • GetLocalIP
    • Contains various networking-related tools.
  • GetRandomPortNumber
    • Generates a random port number.

NumberExtensions.cs

  • IsBetween
    • Determines if a number lies between two numbers. Non-inclusive of the low- and high-bound numbers.
  • IsBetween
    • Determines if a number lies between two numbers.
  • IsPrime
    • Determines if the number is prime.
  • PercentageOf
    • Calculates a value's percentage of another value.
  • PercentageOf
    • Calculates a value's percentage of another value.
  • Round
    • Rounds a double value.
  • RoundDecimalPoints
    • Rounds the supplied decimal to the specified amount of decimal points.
  • RoundToTwoDecimalPoints
    • Rounds the supplied decimal value to two decimal points.
  • Squared
    • Returns the specified number squared.
  • ToCurrencyString
    • Formats a decimal to a currency string.

ObjectExtensions.cs

  • BinarySerialize
    • Serializes an object to a byte array.
  • ConvertTo<T>
    • Converts an object to the specified target type or returns the default value.
  • CopyPropertiesFrom
    • Copies the readable and writable public property values from the source object to the target.
  • CopyPropertiesFrom
    • Copies the readable and writable public property values from the source object to the target and optionally allows for the ignoring of a single property.
  • CopyPropertiesFrom
    • Copies the readable and writable public property values from the source object to the target and optionally allows for the ignoring of any number of properties.
  • IsType
    • Returns a Boolean value indicating whether a variable is of the indicated type.
  • ToJson
    • Serializes an object to a JSON object.
  • ToJson
    • Serializes an object to a JSON object. For complex objects that require recursion, known types my be supplied.
  • FromJson<T>
    • Serializes a JSON object to an object.
  • FromJson<T>
    • Serializes a JSON object to an object. For complex objects that require recursion, known types my be supplied.
  • ToPropertiesString
    • Returns a string representation of the objects property values.
  • ToPropertiesString
    • Returns a string representation of the objects property values, with a delimiter between values.
  • ToXml
    • Serializes the object into an XML string

RegistryUtilities.cs

  • Read
    • Reads specified value from the registry.
  • Write
    • Writes specified value to the registry.
  • Delete
    • Deletes specified value.

SecurityExtensions.cs

  • MD5Verify
    • Verifies a string against the passed MD5 hash.
  • ToMD5
    • MD5 encodes the passed string.

ShapeExtensions.cs

  • MousePercentageFromCenterLeft
    • Calculates the left percentage from a center point within a rectangle. The further the mouse is from the center, the higher the percentage.
  • MousePercentageFromCenterTop
    • Calculates the top percentage from a center point within a rectangle. The further the mouse is from the center, the higher the percentage.
  • MousePercentageFromCenterRight
    • Calculates the right percentage from a center point within a rectangle. The further the mouse is from the center, the higher the percentage.
  • MousePercentageFromCenterBottom
    • Calculates the bottom percentage from a center point within a rectangle. The further the mouse is from the center, the higher the percentage.
  • GetMousePosition
    • Retrieves an accurate mouse position relative to another object.

StringExtensions.cs

  • Base64Decode
    • Base64 decodes a string.
  • Base64Encode
    • Base64 encodes a string.
  • CharacterInstanceCount
    • Gets the number of instances of specified character in the string.
  • Contains
    • An overload of the built-in .NET String.Contains() method, this method determines whether a substring exists within a string in an optionally case-insensitive way.
  • ContainsWords
    • Checks the passed string to see if has any of the passed words. Not case-sensitive.
  • Decrypt
    • Decryptes a string using the supplied key. Decoding is done using RSA encryption.
  • Encrypt
    • Encryptes a string using the supplied key. Encoding is done using RSA encryption.
  • EndsWithAny
    • Determines whether the ending of this instance matches any of the specified strings. Case sensitive.
  • EndsWithAny
    • Determines whether the ending of this string instance matches any of the specified strings. Optionally allows case sensitivity to be specified.
  • EndsWithAny
    • Determines whether the ending of this string instance matches any of the specified strings. Optionally allows case sensitivity to be specified. Optionally allows the culture to be specified.
  • FilterWords
    • Removes all the words passed in the filter words parameters. The replace is NOT case sensitive.
  • FilterWords
    • Removes all the words passed in the filter words parameters using the specified mask. The replace is NOT case sensitive.
  • FindBetween
    • Finds strings that exist between the indicated start and end string patterns.
  • FindBetween
    • Finds strings that exist between the indicated start and end string patterns. Optionally recursive - if true, finds the last instance of the start string before the end string prior to retrieving the results.
  • ForcePrefix
    • Prepends a prefix to a string if it doesn't already exist.
  • ForceSuffix
    • Appends a suffix to a string if it doesn't already exist.
  • FormatPhoneNumber
    • Attempts to format a phone number to a (xxx) xxx-xxxx format.
  • IsDate
    • Detects if a string can be parsed to a valid date.
  • IsDecimal
    • Detects if a string can be parsed to a valid decimal.
  • IsEmpty
    • Determines whether the specified string is null or empty.
  • IsNullOrEmpty
    • Indicates whether the specified System.String object is null or an System.String.Empty string.
  • IsNumeric
    • Determines if a string can be converted to an integer.
  • IsValidCreditCardNumber
    • Detects whether this instance is a valid email credit card number format.
  • IsValidEmailAddress
    • Detects whether this instance is a valid email address.
  • IsValidIPAddress
    • Detects whether the supplied string is a valid IP address.
  • IsValidUrl
    • Checks if url is valid.
  • Left
    • Retrieves the left x characters of a string.
  • MaskCreditCard
    • Masks a credit card string by replacing all characters except the last 4.
  • Mid
    • Retrieves a section of a string.
  • PadLeft
    • Left pads a string using the supplied pad string for the total number of spaces. It will not cut-off the pad even if it causes the string to exceed the total width.
  • PadLeft
    • Left pads a string using the passed pad string for the total number of spaces. Optionally, it will cut-off the pad so that the string does not exceed the total width.
  • PadRight
    • Right pads a string using the supplied pad string for the total number of spaces. It will not cut-off the pad even if it causes the string to exceed the total width.
  • PadRight
    • Right pads a string using the supplied pad string for the total number of spaces. It will cut-off the pad so that the string does not exceed the total width.
  • RemoveDuplicateWords
    • Removes duplicate words from a string.
  • RemoveNewLines
    • Removes the new line (\n) and carriage return (\r) symbols.
  • RemoveNewLines
    • Removes the new line (\n) and carriage return (\r) symbols. Optionally adds a space for each newline and carriage return.
  • RemovePrefix
    • Removes a prefix from a string if it exists.
  • RemoveSpaces
    • Remove whitespace from within a string.
  • RemoveSuffix
    • Removes a suffix from a string if it exists.
  • Replace
    • A case insenstive replace function.
  • Reverse
    • Reverses a string.
  • Right
    • Retrieves the right x characters of a string.
  • SentenceCase
    • Converts a string to sentence case.
  • Slice
    • Retrieves a section of a string by using start and end indexes.
  • SlugDecode
    • Replaces underscores with a space.
  • SlugEncode
    • Replaces spaces with a underscores.
  • Split
    • Splits a string into an array by delimiter.
  • Split
    • Splits a string into an array by delimiter. Optionally allows for the trimming of each token during the split.
  • StartsWithAny
    • Determines whether the beginning of this instance matches any of the specified strings.
  • StartsWithAny
    • Determines whether the beginning of this instance matches any of the specified strings. Optionally allows for case ignorance.
  • StartsWithAny
    • Determines whether the beginning of this instance matches any of the specified strings. Optionally allows the culture to be specified.
  • StripTags
    • Removes all HTML tags from the passed string.
  • TitleCase
    • Converts a string to title case.
  • TitleCase
    • Converts a string to title case. Optionally allows short words to be ignored.
  • ToBoolean
    • Converts the supplied value to an Boolean.
  • ToByteArray
    • Returns a byte array of a specified string.
  • ToColor
    • Convert a (A)RGB string to a Color object.
  • ToDecimal
    • Converts the supplied value to a Decimal.
  • ToInt16
    • Converts the supplied value to an Int16.
  • ToInt32
    • Converts the supplied value to an Int32.
  • ToInt64
    • Converts the supplied value to an Int64.
  • TrimIntraWords
    • Removes multiple spaces between words.
  • TrimAll
    • Trims all whitespace from a string.
  • Truncate
    • Truncates the string to a specified length and replace the truncated to a ...
  • WordCount
    • Counts all words in a given string. Excludes whitespaces, tabs and line breaks.
  • WordInstanceCount
    • Calculates the number of times a word exists withing a string.
  • WordWrap
    • Wraps the passed string up the total number of characters until the next whitespace on or after the total character count has been reached for that line. Uses the environment new line symbol for the break text.
  • WordWrap
    • Wraps the passed string up the total number of characters (if cutOff is true) or until the next whitespace (if cutOff is false). Uses the environment new line symbol for the break text.
  • WordWrap
    • Wraps the passed string up the total number of characters (if cutOff is true) or until the next whitespace (if cutOff is false). Uses the supplied breakText for line breaks.

StringUtilities.cs

  • GetRandomString
    • Returns a random string of the desired size.

SystemUtilities.cs

  • GetOSProductType
    • Returns the product type of the operating system running on this computer.
  • GetOSServicePack
    • Returns the service pack information of the operating system running on this computer.
  • GetOSName
    • Returns the name of the operating system running on this computer.
  • IsXPOrAbove
    • Determines if the system is running Windows XP or above

VideoUtilities.cs

  • ExtractFrames
    • Gets an array of bitmaps which have been extracted from a movie file.
  • FormatFileDuration
    • Formats the duration of a movie to a reader-friendly string.

WebControlExtensions.cs

  • FindControlRecursive
    • Extension method to recursively look for the specified control.

WebExtensions.cs

  • DownloadData
    • Downloads data from a url.
  • DownloadImage
    • Downloads an image from a url.
  • HtmlEncode
    • Converts a string to a HTML encoded string
  • HtmlDecode
    • Decodes a HTML encoded string
  • HtmlSpecialEntitiesDecode
    • A wrapper around HttpUtility.HtmlDecode.
  • HtmlSpecialEntitiesEncode
    • A wrapper around HttpUtility.HtmlEncode.
  • NewLineToBreak
    • Converts new line(\n) and carriage return(\r) symbols to HTML line breaks.
  • PadLeftHtmlSpaces
    • Left pads the passed input using the HTML non-breaking string entity for the total number of spaces.
  • PadRightHtmlSpaces
    • Right pads the passed input using the HTML non-breaking string entity for the total number of spaces.
  • ParseLinks
    • Creates a list of all the links in an html document.
  • ParseImages
    • Creates a list of all the image urls in an html document.
  • ParseQueryString
    • Parses a query string into a NameValueCollection, using the encoding method using default encoding.
  • ParseQueryString
    • Parses a query string into a NameValueCollection. Optionally allows the encoding to be specified.
  • SpaceToNbsp
    • Converts all spaces to HTML non-breaking spaces.
  • UrlEncode
    • Encodes a URL string, using the default encoding.
  • UrlEncode
    • URL encodes the specified string. Optionally allows the encoding to be specified.
  • UrlDecode
    • Converts a string that has been encoded for transmission in a URL into a decoded string, using the default encoding.
  • UrlDecode
    • Converts a string that has been encoded for transmission in a URL into a decoded string. Optionally allows the encoding to be specified.

WebUtilities.cs

  • FetchHTML
    • Retrieves the html contents from a url.
  • FetchTitleFromHTML
    • Parses the title from an html string.
  • GetCurrentPageName
    • Retrieves the file name of the current page.
  • WebPageBitmap
    • Initializes a new instance of the WebPageBitmap class.
  • Fetch
    • Navigates to the url and waits until the web page is fully downloaded.
  • GetBitmap
    • Creates a bitmap for the url of this instance.

XmlExtensions.cs

  • CreateChildNode
    • Appends a child to a XML node.
  • CreateChildNode
    • Appends a child to a XML node.
  • CreateCDataSection
    • Appends a CData section to a XML node.
  • CreateCDataSection
    • Appends a CData section to a XML node and prefills the provided data.
  • GetCDataSection
    • Returns the value of a nested CData section.
  • GetAttribute
    • Gets an attribute value.
  • GetAttribute
    • Gets an attribute value. If the value is empty, uses the specified default value.
  • GetAttribute<T>
    • Gets an attribute value converted to the specified data type
  • GetAttribute<T>
    • Gets an attribute value converted to the specified data type. If the value is empty, uses the specified default value.
  • SetAttribute
    • Creates or updates an attribute with the passed object.
  • SetAttribute
    • Creates or updates an attribute with the passed value.

Last edited Nov 28, 2009 at 1:42 AM by kevinnessland, version 35