code: public static String keepNumbers(String text) {
          StringBuffer sb = new StringBuffer();
          for (int k = 0; k < text.length(); ++k) {
              char c = text.charAt(k);
              if (c >= '0' && c <= '9')
                  sb.append(c);
          }
          return sb.toString();
      }
docs: Deletes all the non numeric characters from <CODE>text</CODE>.
  @param text the text
  @return a <CODE>String</CODE> with only numeric characters