toSlug method
URL-friendly slug (Persian letters kept). "Hello World!" → "hello-world"
Implementation
String toSlug() => trim().toLowerCase().replaceAll(RegExp(r"[^\w-ۿ]+"), "-").replaceAll(RegExp(r"^-+|-+$"), "");
URL-friendly slug (Persian letters kept). "Hello World!" → "hello-world"
String toSlug() => trim().toLowerCase().replaceAll(RegExp(r"[^\w-ۿ]+"), "-").replaceAll(RegExp(r"^-+|-+$"), "");