slugify3 3.0.0 copy "slugify3: ^3.0.0" to clipboard
slugify3: ^3.0.0 copied to clipboard

Converts a string into a slug. Useful for URLs, filenames, IDs, and more.

slugify #

style: effective dart null-safe

Dart package to convert a string to a slug, useful for URLs, filenames, IDs and more.

Features #

  • Removes unfavorable characters
  • Approximates replacements for characters not in the Latin alphabet
  • Options for a custom delimiter and case sensitivity
  • Null-safety compliant

Usage #

import 'package:slugify3/slugify3.dart';

// Use with default options.
String slug = slugify('Hello, World! Foo Bar');
print(slug); // hello-world-foo-bar

// Use with custom options.
String slug2 = slugify('Hello, World! Foo Bar', lowercase: false, delimiter: '🙂');
print(slug2) // Hello🙂World🙂Foo🙂Bar

// Use extension method.
String slug3 = 'Hello, World! Foo Bar'.slugify();
print(slug3) // hello-world-foo-bar

Options #

Name Type Default Description
delimiter String "-" Separator between words
lowercase bool true Convert text to lowercase
0
likes
115
pub points
28%
popularity

Publisher

unverified uploader

Converts a string into a slug. Useful for URLs, filenames, IDs, and more.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (LICENSE)

More

Packages that depend on slugify3