1. Improved the slugify logic.
This commit is contained in:
parent
e1a09ae033
commit
25137bab55
1 changed files with 6 additions and 4 deletions
|
@ -69,10 +69,12 @@ public class UtilityFunctions {
|
|||
* @return
|
||||
*/
|
||||
public static String slugify(String textToBeSlugified) {
|
||||
return StringUtils.substring(textToBeSlugified.toLowerCase()
|
||||
.replaceAll("[^a-zA-Z0-9-]+", "-"),
|
||||
String textBlockSeparator = "-";
|
||||
return StringUtils.removeEnd(StringUtils.substring(textToBeSlugified.toLowerCase().trim()
|
||||
.replaceAll("[^a-zA-Z0-9-]+", textBlockSeparator),
|
||||
0,
|
||||
VisConstants.MAX_NAME_TEXT_LENGTH);
|
||||
VisConstants.MAX_NAME_TEXT_LENGTH),
|
||||
textBlockSeparator);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue