Parsing input format zipcode

Hi, I am looking for an (java) action which sets an input field to a specific format. An input mask is not user friendly enough in this case. E.g. if someone gives the input text 3015 AA (or 3015 AA) , the action must transform it in 3015AA. Does anyone have an example of java ( or microflow ;) ) to tackle this problem?
1 answers

In java, removing whitespace would look like:

public String removeWhiteSpace(String originalvalue) {
  Pattern p = Pattern.compile("\\s+");
  Matcher m = p.matcher(originalvalue);
  return m.replaceAll("");