CapyKit/Documentation/Help/M_CapyKit_Extensions_StringExtensions_IfNullOrWhiteSpace.md
Jordan Wages 87bd044b31 Settings Helper + Documentation
The `SettingsHelper` is an agnostic way to access settings values uniformly through code. The accessor methods are controlled by the consumer.

Documentation has been a bit wonky. I changed the max number of version number components allowed, so each new build should not create new changes on every single bit of documentation now.
2024-04-22 18:28:21 -05:00

50 lines
2.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# IfNullOrWhiteSpace Method
Replaces a null or whitespace string with a specified replacement string.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static string IfNullOrWhiteSpace(
this string value,
string replacement
)
```
**F#**
``` F#
[<ExtensionAttribute>]
static member IfNullOrWhiteSpace :
value : string *
replacement : string -> string
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a></dt><dd>The original string.</dd><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a></dt><dd>The replacement string.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>
The original string if not null or whitespace, otherwise the replacement string.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type <a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>. When you use instance method syntax to call this method, omit the first parameter. For more information, see <a href="https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods" target="_blank" rel="noopener noreferrer">
Extension Methods (Visual Basic)</a> or <a href="https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods" target="_blank" rel="noopener noreferrer">
Extension Methods (C# Programming Guide)</a>.
## See Also
#### Reference
<a href="T_CapyKit_Extensions_StringExtensions.md">StringExtensions Class</a>
<a href="N_CapyKit_Extensions.md">CapyKit.Extensions Namespace</a>
<a href="https://learn.microsoft.com/dotnet/api/system.string.isnullorwhitespace" target="_blank" rel="noopener noreferrer">IsNullOrWhiteSpace(String)</a>