- Notifications
You must be signed in to change notification settings - Fork50
Small utility library for generating speaking URLs.
License
NotificationsYou must be signed in to change notification settings
slugify/slugify
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Small utility library for generating speaking URLs.
Slugify is published in the Maven Central Repository:Click here
finalSlugifyslg =Slugify.builder().build();finalStringresult =slg.slugify("Hello, world!");// result: hello-world
finalSlugifyslg =Slugify.builder().underscoreSeparator(true).build();finalStringresult =slg.slugify("Hello, world!");// result: hello_world
finalSlugifyslg =Slugify.builder().lowerCase(false).build();finalStringresult =slg.slugify("Hello, world!");// result: Hello-world
finalSlugifyslg =Slugify.builder().locale(Locale.GERMAN).build();finalStringresult =slg.slugify("ä");// result: ae
finalSlugifyslg =Slugify.builder()// provided as a map .customReplacements(Map.of("Foo","Hello","bar","world"))// provided as single key-value .customReplacement("Foo","Hello") .customReplacement("bar","world") .build();finalStringresult =slg.slugify("Foo, bar!");// result: hello-world
For Gradle 6+ users there's a feature variant which can be used as follows:
capabilities { requireCapability('com.github.slugify:slugify-transliterator')}For more information about feature variants please check the sectionModeling feature variants and optional dependencies of gradle's user guide.
Manually add the optional dependencycom.ibm.icu:icu4j to your project.
finalSlugifyslg =Slugify.builder().transliterator(true).build();finalStringresult =slg.slugify("Б");// result: b
About
Small utility library for generating speaking URLs.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Contributors5
Uh oh!
There was an error while loading.Please reload this page.