slugify 1.0.0

Dart native js
Flutter Android iOS web

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

Slugify #

Dart[1] 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

Usage #

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

NameTypeDefaultDescription
delimiterString"-"Separator between words
lowercasebooltrueConvert text to lowercase

[1]: This package supports Dart 2

2
likes
95
pub points
80%
popularity

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

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

Uploader

izolate@gmail.com

License

MIT (LICENSE)

More

Packages that depend on slugify