Click or drag to resize

ConversionsGetNullifiedValue Method (IDictionaryString, Object, String, IFormatProvider, String)

Gets a string value from a dictionary by its key/name. If the value is not found, the specified default value will be returned. A whitespaces or empty string will be converted to null.

Namespace:  callback.ShellBoost.Core.Utilities
Assembly:  callback.CBFSShell (in callback.CBFSShell.dll) Version: 22.0.0.0
Syntax
C#
public static string GetNullifiedValue(
	this IDictionary<string, Object> dictionary,
	string key,
	IFormatProvider provider = null,
	string defaultValue = null
)

Parameters

dictionary
Type: System.Collections.GenericIDictionaryString, Object
The input dictionary.
key
Type: SystemString
The key.
provider (Optional)
Type: SystemIFormatProvider
The format provider.
defaultValue (Optional)
Type: SystemString
The default value to use if the value corresponding to the key was not found in the dictionary.

Return Value

Type: String
The value corresponding to the key or the default value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDictionaryString, Object. 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).
Exceptions
ExceptionCondition
ArgumentNullExceptionkey is null.
See Also