Remove Non-ASCII Chars

Quick snippet to remove non-ascii characters from a java string:

String clean = dirty.replaceAll("\\P{ASCII}+", "");

view post
Posted at 7am on 08/25/08 | no comments | Filed Under: Java

Mail from Java

Sometimes you gotta send mail from outside an app server, in which case, this will get you started:

Sending Mail with the JavaMail API

You will need the JavaMail library (mail.jar) as well as the Java Activation Framework (activation.jar) to get it running…

…[continued]

view post
Posted at 11pm on 08/09/08 | no comments | Filed Under: Java