Table of Contents

SlugOptions Class

Definition

Namespace
Bodu.Extensions
Assembly
Bodu.Core.dll
Package
Bodu.Core 1.0.1
Source
SlugOptions.cs

Supplies separator, casing, diacritic, and length configuration for ToSlug(string, SlugOptions).

public sealed class SlugOptions
Inheritance
SlugOptions
Inherited Members
Extension Methods

Remarks

Instances are immutable once constructed: every property is init-only. Construct a customised instance with an object initialiser, or use Default for the standard configuration.

Constructors

SlugOptions()

public SlugOptions()

Properties

Default

Gets a shared SlugOptions instance whose every property holds its default value.

public static SlugOptions Default { get; }

Property Value

SlugOptions

An immutable, reusable options object suitable as the implicit default for slug generation.

Lowercase

Gets a value indicating whether the slug is lower-cased.

public bool Lowercase { get; init; }

Property Value

bool

Defaults to true.

MaxLength

Gets the maximum slug length, or zero for an unbounded slug.

public int MaxLength { get; init; }

Property Value

int

Defaults to 0 (unlimited). When greater than zero, the slug is truncated at a separator boundary so the result never exceeds the limit and never ends with a dangling separator.

NormalizeDiacritics

Gets a value indicating whether diacritical marks are stripped and transliterated before slugging.

public bool NormalizeDiacritics { get; init; }

Property Value

bool

Defaults to true. When set, combining marks are removed and the German sharp-s (ß) is transliterated to ss.

Separator

Gets the character inserted between adjacent words in the slug.

public char Separator { get; init; }

Property Value

char

Defaults to the hyphen '-'.

Applies to

ProductVersions
.NET8, 10