Class StringExtensionMethods
Extension methods for string.
Inherited Members
Namespace: Benday.Common
Assembly: Benday.Common.dll
Syntax
public static class StringExtensionMethods
Methods
| Improve this Doc View SourceSafeToString(string?, string)
This wraps the ToString() method and handles the case where the string is null. Returns the input string if it is not null, otherwise returns the default value.
Declaration
public static string SafeToString(this string? input, string defaultValue = "")
Parameters
Type | Name | Description |
---|---|---|
string | input | |
string | defaultValue | Value to return if null. The default value is empty string. |
Returns
Type | Description |
---|---|
string |