Skip to content

VfsProviderUtils ​

Namespace: MJCZone.MediaMatic.Providers

Assembly: MJCZone.MediaMatic

Summary ​

Utility class for virtual file system providers.

static public

Contents ​

Methods (5)

Methods ​

GenerateSlug ​

Converts an arbitrary string into a URL-safe slug. - Lowercases using invariant culture - Removes diacritics (Γ‘ -> a, ΓΌ -> u, etc.) - Replaces whitespace and common separators with '-' - Collapses multiple '-' and trims from both ends - Keeps only letters, digits, and allowed special characters - If maxLength is specified and exceeded, trims and appends "...{removedCount}" (while keeping total length <= maxLength).

csharp
string GenerateSlug(
    string input,
    string allowedSpecialCharacters,
    Int32} maxLength)

Parameters ​

  • input (string) - Input string.

  • allowedSpecialCharacters (string) - Extra non-alphanumeric characters to allow in the slug. Defaults to the RFC 3986 unreserved specials: "-._~". Letters and digits are always allowed.

  • maxLength (Int32}) - Optional maximum length for the resulting slug. If the slug is longer, it is truncated and suffixed with "...{removedCount}".

Returns ​

Type: string

URL-safe slug string.

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()