v2.0.0
slugify
将字符串转换为 URL 友好的短链接。适用于 URL、文件名、ID 等。
50喜欢 8.6万近 30 天下载135Pub 分数
AndroidiOSWebmacOSWindowsLinux
将字符串转换为 URL 友好的短语,适用于 URL、文件名、ID 等
以下为英文项目原文快照,最新内容请访问 GitHub。
Converts any String to a slug. Useful for URLs, filenames, IDs, and more.
import 'package:slugify/slugify.dart';
// Use with default options.
var slug = slugify('Hello, World! Foo Bar');
print(slug); // hello-world-foo-bar
// Use with custom options.
var slug2 = slugify('Hello, World! Foo Bar', lowercase: false, delimiter: '🙂');
print(slug2) // Hello🙂World🙂Foo🙂Bar
| Name | Type | Default | Description |
|---|---|---|---|
delimiter |
String |
"-" |
Separator between words |
lowercase |
bool |
true |
Convert text to lowercase |
依赖清单 2 项
^1.16.4^1.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗