Method SanitizeHeading
SanitizeHeading(string)
Makes one heading safe to join: control characters go, whitespace runs collapse to a single space, every occurrence of HeadingPathSeparator collapses to a single space, and the result is trimmed. Heading text is display text, so this is lossless in every way a reader would notice and lossy in exactly the way that would otherwise corrupt a boundary. Idempotent, and culture-invariant throughout.
public static string SanitizeHeading(string heading)
Parameters
headingstring