v2.0.0
slugify
將字串轉換為 slug。適用於 URL、檔名、ID 等。
50喜歡 8.6萬近 30 天下載135Pub 分數
AndroidiOSWebmacOSWindowsLinux
將字串轉換為網址友好的簡碼,適用於 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 ↗