Here you can find the source of slugify(String s)
public static final String slugify(String s)
//package com.java2s; //License from project: Apache License import java.io.File; import java.text.Normalizer; import java.util.Collection; import java.util.Map; public class Main { public static final String slugify(String s) { if (s == null) return null; if (s.isEmpty()) return s; String result = Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", ""); result = result.replace(" ", "-"); result = result.toLowerCase();// w w w.jav a 2 s .co m return result; } public static boolean isEmpty(Collection o) { return o == null || o.isEmpty(); } public static final boolean isEmpty(String o) { return o == null || o.length() < 1; } public static final boolean isEmpty(File o) { return o == null || !o.exists() || o.length() < 1L; } public static final boolean isEmpty(Object[] o) { return o == null || o.length < 1; } @SuppressWarnings("unchecked") public static final boolean isEmpty(Map o) { return o == null || o.isEmpty(); } public static final boolean isEmpty(Object o) { return o == null; } }