StringExtensions.Slugify Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

Slugify(string, bool)

Returns a URL friendly version of the input string.

public static string Slugify(this string input, bool file = false)

Parameters

input
string

The string to create url slug for

file
bool

Set to true when the input string contains a filename and you want the slug to end with the extension of the filename, e.g. "uploaded-file.txt" or "uploaded-file.pdf".

Returns

string

An url friendly version of the input string.