@Test public void testGetSlugWithAsciiChars() { Assertions.assertEquals("a-b--c", SlugifyUtils.getSlug("a b -C")); }
public static String getSlug(String str) { if ( str == null ) { return ""; } String noWhiteSpace = WHITESPACE.matcher(str.trim()).replaceAll("-"); try { noWhiteSpace = URLEncoder.encode(noWhiteSpace, "UTF-8"); } catch (UnsupportedEncodingException e) { } String normalized = Normalizer.normalize(noWhiteSpace, Form.NFD); return normalized.toLowerCase(); }
SlugifyUtils { public static String getSlug(String str) { if ( str == null ) { return ""; } String noWhiteSpace = WHITESPACE.matcher(str.trim()).replaceAll("-"); try { noWhiteSpace = URLEncoder.encode(noWhiteSpace, "UTF-8"); } catch (UnsupportedEncodingException e) { } String normalized = Normalizer.normalize(noWhiteSpace, Form.NFD); return normalized.toLowerCase(); } }
SlugifyUtils { public static String getSlug(String str) { if ( str == null ) { return ""; } String noWhiteSpace = WHITESPACE.matcher(str.trim()).replaceAll("-"); try { noWhiteSpace = URLEncoder.encode(noWhiteSpace, "UTF-8"); } catch (UnsupportedEncodingException e) { } String normalized = Normalizer.normalize(noWhiteSpace, Form.NFD); return normalized.toLowerCase(); }  }
SlugifyUtils { public static String getSlug(String str) { if ( str == null ) { return ""; } String noWhiteSpace = WHITESPACE.matcher(str.trim()).replaceAll("-"); try { noWhiteSpace = URLEncoder.encode(noWhiteSpace, "UTF-8"); } catch (UnsupportedEncodingException e) { } String normalized = Normalizer.normalize(noWhiteSpace, Form.NFD); return normalized.toLowerCase(); }  static String getSlug(String str); }
SlugifyUtils { public static String getSlug(String str) { if ( str == null ) { return ""; } String noWhiteSpace = WHITESPACE.matcher(str.trim()).replaceAll("-"); try { noWhiteSpace = URLEncoder.encode(noWhiteSpace, "UTF-8"); } catch (UnsupportedEncodingException e) { } String normalized = Normalizer.normalize(noWhiteSpace, Form.NFD); return normalized.toLowerCase(); }  static String getSlug(String str);  }