StringExtensionsGetValueOrDefault Method |
Retrieves the value of the current string, or, if null/empty, the specified default value.
Namespace:
NetQuarry
Assembly:
EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax public static string GetValueOrDefault(
this string s,
string defaultValue
)
<ExtensionAttribute>
Public Shared Function GetValueOrDefault (
s As String,
defaultValue As String
) As String
Parameters
- s
- Type: SystemString
The current string. - defaultValue
- Type: SystemString
The default string to return if the current string is null/empty.
Return Value
Type:
StringThe current string, or if the current string is null/empty, the default value.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also