Skip to content

DefaultFilenameFormatSanitizer.SanitizePlaceholder method

Default implementation for sanitizing values of replacement placeholders in a file name format string like |X|/|Y|. Trims the value, and if it is empty, returns "_". Characters like '/', '&', and diacritics etc. are replaced by calling StringHelper.SanitizeFileName, then replacing backslashes with underscore, and double dots and trailing dots with underscore.

public virtual string SanitizePlaceholder(string _, string? value)
parameter description
_ Key for placeholder, ignored by this implementation.
value Value to be sanitized.

See Also