Table of Contents

Class StringExtensions

Namespace
Heleonix.Extensions
Assembly
Heleonix.Extensions.dll

Provides functionality to work with strings.

public static class StringExtensions
Inheritance
StringExtensions
Inherited Members

Methods

FormatWith(string, IFormatProvider, params object[])

Formats the specified format string with the specified arguments using a specified format provider.

public static string FormatWith(this string format, IFormatProvider formatProvider, params object[] args)

Parameters

format string

The format.

formatProvider IFormatProvider

The format provider.

args object[]

The arguments.

Returns

string

Formatted string or empty string if format is not specified.

Exceptions

ArgumentNullException

The formatProvider is null.

FormatException

format is invalid the index of a format item is less than zero, or greater than or equal to the length of the args array.

FormatWith(string, params object[])

Formats the specified format string with the specified arguments.

public static string FormatWith(this string format, params object[] args)

Parameters

format string

The format.

args object[]

The arguments.

Returns

string

Formatted string or empty string if format is not specified.

Examples

var str = "{0} plus {1} equals {2}".FormatWith(1, 2, 3);

// "1 plus 2 equals 3".

Exceptions

FormatException

format is invalid or the index of a format item is less than zero, or greater than or equal to the length of the args array.

IsNullOrEmptyOrWhiteSpace(string)

Determines whether this instance is null or empty or whitespace.

public static bool IsNullOrEmptyOrWhiteSpace(this string instance)

Parameters

instance string

The instance.

Returns

bool

true if this instance is null or empty or whitespace, otherwise, false.