How to Sanitize Blog Title, to use as Permalink, in Java
By Angsuman Chakraborty, Gaea News NetworkSunday, June 12, 2005
Most Blog software provides an option to use a sanitized version of the post title as part of permalink url. Thingamablog, a Java based offline blogging software, doesn’t do it. So I decided to create one for myself in Java.
To see an example of what I am talking about, see the permalink (permanent link) of this post - https://blog.taragana.com/index.php/archive/how-to-sanitize-blog-title-to-use-as-permalink-in-java/. It contains the title ( How to Sanitize Blog Title, to use as Permalink, in Java ) with ‘-’ as separator, and without spaces, punctuations etc.
Here is what you would do to sanitize any text in Java:
title.replaceAll(”[\W]+”, “-”)
Note: The second argument is the separator to use.
That’s it! Isn’t Java simple?
February 15, 2007: 6:38 am
بدالله عبدالقوي غانم الحميري طالب جامعي من مواليد الدير عوابل شعوبة مديرية المعافر حجرية محافضة تعز طالب جامعي جامعة صنعاء كلية التجارة |
عبدالله عبدالقوي غانم الحميري