StringExtensionToString Method (String, String, Boolean) |
Returns the str or the defaultValue if the str is null.
Namespace: ArtDatabankenAssembly: ArtDatabanken (in ArtDatabanken.dll) Version: 1.3.0.0 (1.3.0.0)
Syntax public static string ToString(
this string str,
string defaultValue,
bool considerWhiteSpaceIsEmpty = false
)
<ExtensionAttribute>
Public Shared Function ToString (
str As String,
defaultValue As String,
Optional considerWhiteSpaceIsEmpty As Boolean = false
) As String
public:
[ExtensionAttribute]
static String^ ToString(
String^ str,
String^ defaultValue,
bool considerWhiteSpaceIsEmpty = false
)
[<ExtensionAttribute>]
static member ToString :
str : string *
defaultValue : string *
?considerWhiteSpaceIsEmpty : bool
(* Defaults:
let _considerWhiteSpaceIsEmpty = defaultArg considerWhiteSpaceIsEmpty false
*)
-> string
Parameters
- str
- Type: SystemString
The string. - defaultValue
- Type: SystemString
The string to show when the source is null.
If null an empty string is returned. - considerWhiteSpaceIsEmpty (Optional)
- Type: SystemBoolean
if set to true and str is white space, then the defaultValue is returned.
Return Value
Type:
StringThe
str or the
defaultValue if the
str is
null.
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