ksdev-pl / slugify

Create a URL/filesystem-friendly version of a string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Create a URL/filesystem-friendly version of a string

License:MIT License


Languages

Language:Java 100.0%