Wednesday, August 18, 2010

Different message types in JMS

JMS defines six message interface types; a base message type and five subtypes. The message types are defined according to the type of the message payload, where the payload is the body of a message that holds the content.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac24862_.htm

RemoveCharacters from a given string

public class removeChar {
public static String getOnlyNumerics(String str) {
if (str == null) {
return null;
}
StringBuffer strBuff = new StringBuffer();
char c;
for (int i = 0; i < str.length(); i++) {
c = str.charAt(i);
if (Character.isDigit(c)) {
strBuff.append(c);
}
}
return strBuff.toString();
}

public static void main(String[] args) {
removeChar r = new removeChar();
System.out.println(r.getOnlyNumerics("USDOT549189"));
}
}