Skip to content

Create a URL/filesystem-friendly version of a string

License

Notifications You must be signed in to change notification settings

ksdev-pl/slugify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slugify

Latest Version on Maven Software License Build Status Coverage Status

Create a URL/filesystem-friendly version of a string.

Install

Via Maven

<dependency>
  <groupId>pl.ksdev</groupId>
  <artifactId>slugify</artifactId>
  <version>0.3</version>
</dependency>

Via Gradle

compile 'pl.ksdev:slugify:0.3'

Usage

SlugService slugService = new SimpleSlugService();
String result = slugService.slugify("Zażółć gęślą jaźń");   // result = "zazolc-gesla-jazn"

SlugService slugService = new SimpleSlugService(5);         // adds a max slug length (default = 200)
String result = slugService.slugify("1234567890");          // result = "12345"

License

The MIT License (MIT). Please see License File for more information.