slugify_string 2.0.0 copy "slugify_string: ^2.0.0" to clipboard
slugify_string: ^2.0.0 copied to clipboard

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

Slugify #

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

Forked from slugify in order to support null-safety.

Features #

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

Usage #

import 'package:slugify_string/slugify.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

Options #

Name Type Default Description
delimiter String "-" Separator between words
lowercase bool true Convert text to lowercase
3
likes
125
pub points
42%
popularity

Publisher

verified publishermadewithfelt.com

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on slugify_string