GetString(IMetadata, string, Func<string, string>, string) Method
Formats a string value if it exists in the metadata, otherwise returns a default value.
Namespace
Statiq.Common
Containing Type
IMetadataConversionExtensions

Syntax

public static string GetString(this IMetadata metadata, string key, Func<string, string> formatFunc, string defaultValue = null)

Parameters

Name Type Description
metadata IMetadata The metadata instance.
key string The key of the value to get.
formatFunc Func<string, string> A formatting function to apply to the string value of the specified key.
defaultValue string The default value to use if the key is not found.

Return Value

Type Description
string The formatted value of the specified key if it exists or the specified default value.