Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.52 KB

README.md

File metadata and controls

49 lines (35 loc) · 1.52 KB

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.