public static String getDigitsOnly(final String value) {
    final StringBuilder buffer = new StringBuilder();

    if (value != null) {
      for (final char chr : value.toCharArray()) {
        if (Character.isDigit(chr)) {
          buffer.append(chr);
        }
      }
    }

    return buffer.toString();
  }
Returns only the digits (0..9) from the specified String value.
<p>

@param value the String value from which to extract digits.
@return only the digits from the specified String value. If the String is null or contains no
        digits, then this method returns an empty String.
@see java.lang.Character#isDigit(char)
geode-core/src/main/java/org/apache/geode/internal/lang/StringUtils.java