Class StringExtensions
Provides static extentions methods for providing additional functionality for string types.
Namespace: CapyKit.Extensions
Assembly: CapyKit.dll
Syntax
public static class StringExtensions
Methods
IfNullOrEmpty(string, string)
Replaces a null or empty string with a specified replacement string.
Declaration
public static string IfNullOrEmpty(this string value, string replacement)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The original string. |
| string | replacement | The replacement string. |
Returns
| Type | Description |
|---|---|
| string | The original string if not null or empty, otherwise the replacement string. |
See Also
IfNullOrWhiteSpace(string, string)
Replaces a null or whitespace string with a specified replacement string.
Declaration
public static string IfNullOrWhiteSpace(this string value, string replacement)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The original string. |
| string | replacement | The replacement string. |
Returns
| Type | Description |
|---|---|
| string | The original string if not null or whitespace, otherwise the replacement string. |