IsNullThen
Replaces NULL with the specified replacement value.
Source
public static string IsNullThen(this string str, string alt)
{
return str ?? alt ?? string.Empty;
}
Example
string example = someString.IsNullThen("AlternateValue");
ExtensionMethod.NET Home of 881 C#, Visual Basic, F# and Javascript extension methods
Replaces NULL with the specified replacement value.
public static string IsNullThen(this string str, string alt)
{
return str ?? alt ?? string.Empty;
}
string example = someString.IsNullThen("AlternateValue");