Created
August 9, 2016 21:00
-
-
Save ricardodestro/49fc321de2218477cd7b8b780015a2aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Normaliza string | |
* | |
* @param s | |
* @return | |
*/ | |
public static String normalize(String s) { | |
return Normalizer.normalize(s, Form.NFD).toLowerCase().replaceAll("\\p{P}", "").replaceAll("\\s+", "-") | |
.replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment