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
formatstringThe format.
formatProviderIFormatProviderThe format provider.
argsobject[]The arguments.
Returns
- string
Formatted string or empty string if
formatis not specified.
Exceptions
- ArgumentNullException
The
formatProviderisnull.- FormatException
formatis invalid the index of a format item is less than zero, or greater than or equal to the length of theargsarray.
FormatWith(string, params object[])
Formats the specified format string with the specified arguments.
public static string FormatWith(this string format, params object[] args)
Parameters
Returns
- string
Formatted string or empty string if
formatis not specified.
Examples
var str = "{0} plus {1} equals {2}".FormatWith(1, 2, 3);
// "1 plus 2 equals 3".
Exceptions
- FormatException
formatis invalid or the index of a format item is less than zero, or greater than or equal to the length of theargsarray.
IsNullOrEmptyOrWhiteSpace(string)
Determines whether this instance is null or empty or whitespace.
public static bool IsNullOrEmptyOrWhiteSpace(this string instance)
Parameters
instancestringThe instance.
Returns
- bool
trueif this instance isnullor empty or whitespace, otherwise,false.